Timers_Class

singleShot()

Description

This function is the most important one in the library since it has much work to do. First of all, it looks for free timer instance. Then, it connects the interrupt line to the timerInterruptHandlerSS() function, where we call the handling fuction (given as an argument). Once connected, setPeriodMilliseconds() is used to do all needed configurations. Finally, when the timer instance is ready, start() is called. SingleShot() function treats also all failure cases by returnig error codes.

Syntax

For more flexibility, this method is overloaded:

  • timer.singleShot(msec, function, arg, timerid)

  • timer.singleShot(msec, function, timerid) => arg = 0

Parameters

timer: a variable of type Timers_Class .

msec: the new period divider used by setPeriodMilliseconds() , type int.

function: a function pointer refers to the handling user program, type void.

arg: an argument for the previous function, type void.

timerid: the timer instance, type int, default -1.

See also

Corrections, suggestions, and new documentation can be added directly to the wiki page. Scroll to the bottom, choose "Edit Page" and use "Papilio" as the password.

  

Share |