ioLibrary for Cortex M series
|
![]() |
Functions | |
int8_t | alarm_set (uint32_t time, alarm_cbfunc cb, int8_t arg) |
int8_t | alarm_del (alarm_cbfunc cb, int8_t arg) |
int8_t | alarm_chk (alarm_cbfunc cb, int8_t arg) |
void | alarm_run (void) |
Event Alarm Module. You can register delayed action through Alarm Module.
int8_t alarm_set | ( | uint32_t | time, |
alarm_cbfunc | cb, | ||
int8_t | arg | ||
) |
Add Alarm event to the waiting queue.
time | Delay time in tick. Max time is defined in common.h Zero time param is possible |
cb | Callback function in alarm_cbfunc form |
arg | The value which will be returned through callback function This is for separation in same callback function |
Definition at line 78 of file util.c.
References alarm_node_t::arg, alarm_node_t::cb, ERRA, MAX_TICK_ELAPSE, alarm_node_t::next, RET_NOK, RET_OK, alarm_node_t::time, and wizpf_get_systick().
int8_t alarm_del | ( | alarm_cbfunc | cb, |
int8_t | arg | ||
) |
Delete Alarm event from the waiting queue. This function delete every alarm event which have same condition with param
cb | Callback function in alarm_cbfunc form NULL value will be ignored |
arg | The value which was set when alarm event added as arg -1 value will be ignored |
Definition at line 119 of file util.c.
References alarm_node_t::arg, alarm_node_t::cb, DBGA, and alarm_node_t::next.
int8_t alarm_chk | ( | alarm_cbfunc | cb, |
int8_t | arg | ||
) |
Count Alarm event which have same condition with param from the waiting queue. If there is not alarm event same with param, 0 value will be returned.
cb | Callback function in alarm_cbfunc form NULL value will be ignored |
arg | The value which was set when alarm event added as arg -1 value will be ignored |
Definition at line 151 of file util.c.
References DBGA, and alarm_node_t::next.
void alarm_run | ( | void | ) |
Alarm Module Handler. If you use alarm, this function should run in the main loop
Definition at line 173 of file util.c.
References alarm_node_t::arg, alarm_node_t::cb, alarm_node_t::next, alarm_node_t::time, and wizpf_tick_elapse().