...
- Do not call this function from an ISR.
- The timer is not started when it is created. To start the timer, simply call
OSTmrStart()
. - Do not make blocking calls within callback functions.
- Keep callback functions as short as possible.
Example Usage
Code Block | ||
---|---|---|
| ||
OS_TMR CloseDoorTmr; void Task (void *p_arg) { OS_ERR err; (void)&p_arg; while (DEF_ON) { OSTmrCreate(&CloseDoorTmr, /* p_tmr */ "Door close", /* p_name */ 10, /* dly */ 100, /* period */ OS_OPT_TMR_PERIODIC, /* opt */ DoorCloseFnct, /* p_callback */ 0, /* p_callback_arg */ &err); /* p_err */ /* Check "err" */ : : } } void DoorCloseFnct (OS_TMR *p_tmr, void *p_arg) { /* Close the door! */ } |
...