219 #if TN_DYNAMIC_TICK || defined(DOXYGEN_ACTIVE) 233 #if !TN_DYNAMIC_TICK || defined(DOXYGEN_ACTIVE) 246 #if TN_DYNAMIC_TICK || defined(DOXYGEN_ACTIVE) 458 #endif // _TN_TIMER_H enum TN_RCode tn_timer_cancel(struct TN_Timer *timer)
If timer is active, cancel it.
enum TN_RCode tn_timer_create(struct TN_Timer *timer, TN_TimerFunc *func, void *p_user_data)
Construct the timer.
struct TN_ListItem timer_queue
A list item to be included in the system timer queue.
enum TN_RCode tn_timer_delete(struct TN_Timer *timer)
Destruct the timer.
Circular doubly linked list, for internal kernel usage.
void() TN_TimerFunc(struct TN_Timer *timer, void *p_user_data)
Prototype of the function that should be called by timer.
enum TN_RCode tn_timer_is_active(struct TN_Timer *timer, TN_BOOL *p_is_active)
Returns whether given timer is active or inactive.
TN_RCode
Result code returned by kernel services.
TN_ObjId
Magic number for object validity verification.
unsigned long TN_TickCnt
Type for system tick count, it is used by the kernel to represent absolute tick count value as well a...
enum TN_RCode tn_timer_set_func(struct TN_Timer *timer, TN_TimerFunc *func, void *p_user_data)
Set user-provided function and pointer to user data for the timer.
Definitions used through the whole kernel.
TN_TickCnt start_tick_cnt
Available if only TN_DYNAMIC_TICK is set.
enum TN_ObjId id_timer
id for object validity verification.
void() TN_CBTickSchedule(TN_TickCnt timeout)
Available if only TN_DYNAMIC_TICK is set.
TN_TickCnt() TN_CBTickCntGet(void)
Available if only TN_DYNAMIC_TICK is set.
TN_TimerFunc * func
Function to be called by timer.
TN_TickCnt timeout
Available if only TN_DYNAMIC_TICK is set.
TN_TickCnt timeout_cur
Available if only TN_DYNAMIC_TICK is not set.
enum TN_RCode tn_timer_start(struct TN_Timer *timer, TN_TickCnt timeout)
Start or restart the timer: that is, schedule the timer's function (given to tn_timer_create()) to be...
void * p_user_data
User data pointer that is given to user-provided func.
enum TN_RCode tn_timer_time_left(struct TN_Timer *timer, TN_TickCnt *p_time_left)
Returns how many system timer ticks (at most) is left for the timer to expire.
Circular doubly linked list item, for internal kernel usage.
#define TN_BOOL
boolean type definition