51 static char initialized;
56 #define PRINTF(...) printf(__VA_ARGS__)
62 PROCESS(ctimer_process,
"Ctimer process");
69 etimer_set(&c->etimer, c->etimer.timer.interval);
76 if(&c->etimer == data) {
100 void (*f)(
void *),
void *ptr)
102 PRINTF(
"ctimer_set %p %u\n", c, (
unsigned)t);
111 c->etimer.timer.interval = t;
147 c->etimer.next =
NULL;
148 c->etimer.p = PROCESS_NONE;
#define PROCESS_CURRENT()
Get a pointer to the currently running process.
Linked list manipulation routines.
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
#define PROCESS_BEGIN()
Define the beginning of a process.
int ctimer_expired(struct ctimer *c)
Check if a callback timer has expired.
#define NULL
The null pointer.
void list_remove(list_t list, void *item)
Remove a specific element from a list.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
void ctimer_restart(struct ctimer *c)
Restart a callback timer from the current point in time.
void list_init(list_t list)
Initialize a list.
void ctimer_set(struct ctimer *c, clock_time_t t, void(*f)(void *), void *ptr)
Set a callback timer.
void * list_head(list_t list)
Get a pointer to the first element of a list.
void ctimer_init(void)
Initialize the callback timer library.
void list_add(list_t list, void *item)
Add an item at the end of a list.
void ctimer_reset(struct ctimer *c)
Reset a callback timer with the same interval as was previously set.
#define PROCESS(name, strname)
Declare a process.
#define LIST(name)
Declare a linked list.
Header file for the callback timer
void etimer_reset(struct etimer *et)
Reset an event timer with the same interval as was previously set.
void process_start(struct process *p, process_data_t data)
Start a process.
void etimer_stop(struct etimer *et)
Stop a pending event timer.
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
#define PROCESS_CONTEXT_BEGIN(p)
Switch context to another process.
void etimer_restart(struct etimer *et)
Restart an event timer from the current point in time.
#define PROCESS_YIELD_UNTIL(c)
Yield the currently running process until a condition occurs.
void ctimer_stop(struct ctimer *c)
Stop a pending callback timer.
#define PROCESS_CONTEXT_END(p)
End a context switch.