Re-format code to avoid overly long lines and declarations
This commit is contained in:
+11
-8
@@ -46,8 +46,9 @@ typedef void (*uc_timer_cb)(struct UCTimers *timers, struct UCTimer *timer);
|
||||
struct UCTimer {
|
||||
//Internal members
|
||||
RBNode rb_node; //the RBNode will hold a data pointer to the
|
||||
//the UCTimer it's a member of. We might get rid of that member, and use CONTAINER_OF
|
||||
//to find the UCTimer from a RBNode (Or just cast it, it's the 1. member..)
|
||||
//the UCTimer it's a member of. We might get rid of that
|
||||
//member, and use CONTAINER_OF to find the UCTimer from
|
||||
//a RBNode (Or just cast it, it's the 1. member..)
|
||||
|
||||
//absolute time when the timer should be fired
|
||||
struct timeval timeout;
|
||||
@@ -73,7 +74,8 @@ struct UCTimers {
|
||||
RBTree timer_tree;
|
||||
struct UCoreClock *uclock;
|
||||
size_t seq; //used to generate unique timers
|
||||
TAILQ_HEAD(, UCTimer) ready_list; //pending timers to be fired while inside uc_timers_run
|
||||
TAILQ_HEAD(, UCTimer) ready_list; //pending timers to be fired while
|
||||
//inside uc_timers_run
|
||||
};
|
||||
|
||||
/** Initialize a timer engine for use.
|
||||
@@ -103,8 +105,8 @@ void uc_timers_init_ex(struct UCTimers *t, struct UCoreClock *uclock);
|
||||
void uc_timers_add(struct UCTimers *timers, struct UCTimer *timer, int sec, int usec);
|
||||
|
||||
/** Remove a timer.
|
||||
* Note, the timer memory must have been zeroed out or the timer must have been added at least once
|
||||
* before uc_timers_remove can be called on a UCTimer.
|
||||
* Note, the timer memory must have been zeroed out or the timer must have been
|
||||
* added at least once before uc_timers_remove can be called on a UCTimer.
|
||||
* uc_timers_remove does nothing if the timer has expired.
|
||||
*
|
||||
* @param timers timer engine to remove from
|
||||
@@ -131,7 +133,8 @@ size_t uc_timers_count(const struct UCTimers *timers);
|
||||
/** Check if a timer is running (i.e. hasn't expired and fired)
|
||||
*
|
||||
* @param timer timer to query
|
||||
* @return 0 if the timer has expired (or was never added) non-0 if it's running (active or pending)
|
||||
* @return 0 if the timer has expired (or was never added) non-0 if it's
|
||||
* running (active or pending)
|
||||
*/
|
||||
int uc_timer_running(const struct UCTimer *timer);
|
||||
|
||||
@@ -141,8 +144,8 @@ int uc_timer_running(const struct UCTimer *timer);
|
||||
* @param timers timer engine to run
|
||||
* @param now The curent time. The engine will fire all timers whose expiry time is
|
||||
* prior to this value.
|
||||
* @return the number of timers fired, or negative if an error occured(presently no errors
|
||||
* are possible and the return value is always >= 0
|
||||
* @return the number of timers fired, or negative if an error occured(presently
|
||||
* no errors are possible and the return value is always >= 0
|
||||
**/
|
||||
int uc_timers_run(struct UCTimers *timers);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user