inc/ecu/timer.h Source File
|
ECU
|
timer.h
Go to the documentation of this file.
73 };
Single node within list. Intrusive, so user-defined types contain this node as a member.
Definition: dlist.h:166
ecu_tick_t period
Timer expires once elapsed ticks exceeds this value.
Definition: timer.h:94
bool(* callback)(struct ecu_timer *me, void *obj)
Mandatory callback that executes when timer expires. First parameter passed is this timer object....
Definition: timer.h:105
ecu_tick_t expiration
Absolute time, in ticks, when this timer expires.
Definition: timer.h:91
Timer linked list that runs all software timers (ecu_timer) added to it. Each list usually holds mult...
Definition: timer.h:120
bool overflowed
True if ecu_tlist::current overflowed. Flag set back to false once overflow handled....
Definition: timer.h:127
struct ecu_dlist timers
Ordered linked list of timers that are running. Ordered by ecu_timer::expiration.
Definition: timer.h:131
ecu_tick_t current
Absolute timestamp, in ticks. Incremented with each call to ecu_tlist_service(). Overflow is automati...
Definition: timer.h:123
struct ecu_dlist wraparounds
Ordered linked list of timers that are running, but expire after an ecu_tlist::current overflow....
Definition: timer.h:137
void ecu_timer_set(struct ecu_timer *me, ecu_tick_t period, enum ecu_timer_type_e type)
Stops the timer if it was running and reconfigures it with the newly supplied settings....
unsigned int ecu_tick_t
To remain portable, units of time are measured arbitrarily in ticks. It is the application's responsi...
Definition: timer.h:62
void ecu_timer_ctor(struct ecu_timer *me, bool(*callback)(struct ecu_timer *me, void *obj), void *obj)
Timer constructor.
bool ecu_timer_active(const struct ecu_timer *me)
Returns true if the timer is currently running. False otherwise.
ecu_tick_t ecu_timer_period(const struct ecu_timer *me)
Returns the timer's period that was set when it was started.
void ecu_tlist_service(struct ecu_tlist *me, ecu_tick_t elapsed)
Services all software timers (ecu_timer) currently in the list. Servicing involves expiring appropria...
void ecu_tlist_timer_arm(struct ecu_tlist *me, struct ecu_timer *timer, ecu_tick_t period, enum ecu_timer_type_e type)
Starts a timer with the specified settings. If the timer is already running it is restarted and recon...
enum ecu_timer_type_e ecu_timer_type(const struct ecu_timer *me)
Returns the timer's type that was specified when it was started.
void ecu_tlist_timer_rearm(struct ecu_tlist *me, struct ecu_timer *timer)
Restarts the timer with its same settings.
void ecu_timer_disarm(struct ecu_timer *me)
Stops the timer. Timer can be rearmed without reconstruction. This function can be used on a timer th...
Generated by