51 static char initialized;
56 #define PRINTF(...) printf(__VA_ARGS__) 62 PROCESS(ctimer_process,
"Ctimer process");
68 for(c =
list_head(ctimer_list); c != NULL; c = c->next) {
69 etimer_set(&c->etimer, c->etimer.timer.interval);
75 for(c =
list_head(ctimer_list); c != NULL; c = c->next) {
76 if(&c->etimer == data) {
100 void (*f)(
void *),
void *ptr)
107 void (*f)(
void *),
void *ptr,
struct process *p)
109 PRINTF(
"ctimer_set %p %lu\n", c, (
unsigned long)t);
118 c->etimer.timer.interval = t;
154 c->etimer.next = NULL;
155 c->etimer.p = PROCESS_NONE;
167 for(t =
list_head(ctimer_list); t != NULL; t = t->next) {
int ctimer_expired(struct ctimer *c)
Check if a callback timer has expired.
#define PROCESS(name, strname)
Declare a process.
void ctimer_stop(struct ctimer *c)
Stop a pending callback timer.
void etimer_stop(struct etimer *et)
Stop a pending event timer.
#define PROCESS_CONTEXT_END(p)
End a context switch.
void ctimer_set_with_process(struct ctimer *c, clock_time_t t, void(*f)(void *), void *ptr, struct process *p)
Set a callback timer.
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.
#define PROCESS_BEGIN()
Define the beginning of a process.
#define PROCESS_END()
Define the end of a process.
void ctimer_init(void)
Initialize the callback timer library.
void ctimer_reset(struct ctimer *c)
Reset a callback timer with the same interval as was previously set.
#define PROCESS_CURRENT()
Get a pointer to the currently running process.
Header file for the callback timer
Linked list manipulation routines.
void * list_head(list_t list)
Get a pointer to the first element of a list.
void ctimer_set(struct ctimer *c, clock_time_t t, void(*f)(void *), void *ptr)
Set a callback timer.
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
void ctimer_restart(struct ctimer *c)
Restart a callback timer from the current point in time.
void list_add(list_t list, void *item)
Add an item at the end of a list.
void list_init(list_t list)
Initialize a list.
#define LIST(name)
Declare a linked list.
#define PROCESS_CONTEXT_BEGIN(p)
Switch context to another process.
PROCESS_THREAD(cc2538_rf_process, ev, data)
Implementation of the cc2538 RF driver process.
void etimer_reset(struct etimer *et)
Reset an event timer with the same interval as was previously set.
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
void list_remove(list_t list, void *item)
Remove a specific element from a list.
void process_start(struct process *p, process_data_t data)
Start a process.