ESP8266_RTOS_SDK  v1.4.0
Functions
Software timer APIs

Software timer APIs. More...

Functions

void os_timer_setfn (os_timer_t *ptimer, os_timer_func_t *pfunction, void *parg)
 Set the timer callback function. More...
 
void os_timer_arm (os_timer_t *ptimer, uint32 msec, bool repeat_flag)
 Enable the millisecond timer. More...
 
void os_timer_disarm (os_timer_t *ptimer)
 Disarm the timer. More...
 

Detailed Description

Software timer APIs.

Timers of the following interfaces are software timers. Functions of the timers are executed during the tasks. Since a task can be stopped, or be delayed because there are other tasks with higher priorities, the following os_timer interfaces cannot guarantee the precise execution of the timers.

Function Documentation

void os_timer_arm ( os_timer_t ptimer,
uint32  msec,
bool  repeat_flag 
)

Enable the millisecond timer.

Parameters
os_timer_t*ptimer : timer structure
uint32_tmilliseconds : Timing, unit: millisecond, range: 5 ~ 0x68DB8
boolrepeat_flag : Whether the timer will be invoked repeatedly or not
Returns
null
void os_timer_disarm ( os_timer_t ptimer)

Disarm the timer.

Parameters
os_timer_t*ptimer : Timer structure
Returns
null
void os_timer_setfn ( os_timer_t ptimer,
os_timer_func_t *  pfunction,
void *  parg 
)

Set the timer callback function.

Attention
1. The callback function must be set in order to enable the timer.
2. Operating system scheduling is disabled in timer callback.
Parameters
os_timer_t*ptimer : Timer structure
os_timer_func_t*pfunction : timer callback function
void*parg : callback function parameter
Returns
null