NetBurner 3.1
Interval Timer

The NetBurner Interval Timer. More...

Functions

int IntervalOSSem (OS_SEM *p_toSem, int num_per_sec, int timer=IFIRST_UNUSED_TIMER)
 Posts to a semaphore at the requested interval. More...
 
int IntervalOSFlag (OS_FLAGS *p_toFlag, uint32_t flag_value, int num_per_sec, int timer=IFIRST_UNUSED_TIMER)
 Sets a flag at requested interval. More...
 
int IntervalInterruptCallback (void(*p_toCallbackFunc)(), int num_per_sec, int timer=IFIRST_UNUSED_TIMER)
 Calls a function at requested interval. Note that the callback function is called from within the timer's interrupt handler so you should treat your callback function as an interrupt. More...
 
void IntervalStop (int timer_number)
 Stops an existing Interval Timer and frees the resource. More...
 

Detailed Description

The NetBurner Interval Timer.

Function Documentation

◆ IntervalInterruptCallback()

int IntervalInterruptCallback ( void(*)()  p_toCallbackFunc,
int  num_per_sec,
int  timer = IFIRST_UNUSED_TIMER 
)

Calls a function at requested interval. Note that the callback function is called from within the timer's interrupt handler so you should treat your callback function as an interrupt.

Parameters
p_toCallbackFuncPointer to the callback function
num_per_secNumber of posts per second
timerOptional parameter, timer number of -1 for first unused timer
Returns
The timer number, -1 if no timer is available, or -2 if num_per_sec is invalid.

◆ IntervalOSFlag()

int IntervalOSFlag ( OS_FLAGS p_toFlag,
uint32_t  flag_value,
int  num_per_sec,
int  timer = IFIRST_UNUSED_TIMER 
)

Sets a flag at requested interval.

Parameters
p_toSemPointer to the semaphore
flag_valueOS Flag value to set
num_per_secNumber of posts per second
timerOptional parameter, timer number of -1 for first unused timer
Returns
The timer number, -1 if no timer is available, or -2 if num_per_sec is invalid.

◆ IntervalOSSem()

int IntervalOSSem ( OS_SEM p_toSem,
int  num_per_sec,
int  timer = IFIRST_UNUSED_TIMER 
)

Posts to a semaphore at the requested interval.

Parameters
p_toSemPointer to the semaphore
num_per_secNumber of posts per second
timerOptional parameter, timer number of -1 for first unused timer
Returns
The timer number, -1 if no timer is available, or -2 if num_per_sec is invalid.

◆ IntervalStop()

void IntervalStop ( int  timer_number)

Stops an existing Interval Timer and frees the resource.

Parameters
timer_numberNumber of the timer to stop.