164 }
else if (tmo == OS_WAIT_FOREVER) {
Provides a callback-with-argument event type.
void event_callback_init(event_callback_t *event_callback, void(*callback)(void *), void *arg)
event callback initialization function
static size_t clist_count(clist_node_t *list)
Count the number of items in the given list.
void event_post(event_queue_t *queue, event_t *event)
Queue an event.
static event_t * event_wait(event_queue_t *queue)
Get next event from event queue, blocking.
event_t * event_wait_timeout_ztimer(event_queue_t *queue, ztimer_clock_t *clock, uint32_t timeout)
Get next event from event queue, blocking until timeout expires.
void event_cancel(event_queue_t *queue, event_t *event)
Cancel a queued event.
static void event_queue_init_detached(event_queue_t *queue)
Initialize an event queue not binding it to a thread.
static void event_queue_claim(event_queue_t *queue)
Bind an event queue to the calling thread.
event_t * event_get(event_queue_t *queue)
Get next event from event queue, non-blocking.
ztimer_clock_t *const ZTIMER_MSEC
Default ztimer millisecond clock.
static bool os_eventq_is_empty(struct os_eventq *evq)
Check if queue is empty.
static struct os_event * os_eventq_get_no_wait(struct os_eventq *evq)
Get next event from event queue, non-blocking.
static void os_event_init(struct os_event *ev, os_event_fn *fn, void *arg)
Init a event.
static void os_event_set_arg(struct os_event *ev, void *arg)
Set the event argument.
static int os_eventq_inited(struct os_eventq *evq)
Check whether the event queue is initialized.
static struct os_event * os_eventq_get(struct os_eventq *evq, os_time_t tmo)
Get next event from event queue.
static void os_eventq_deinit(struct os_eventq *evq)
Deinitialize an event queue.
static void os_eventq_remove(struct os_eventq *evq, struct os_event *ev)
Remove an event from the queue.
static bool os_event_is_queued(struct os_event *ev)
Check if event is in queue.
void os_event_fn(struct os_event *ev)
Event callback function.
static void os_event_run(struct os_event *ev)
Runs an event.
static void os_eventq_init(struct os_eventq *evq)
Initialize the event queue.
static void os_eventq_put(struct os_eventq *evq, struct os_event *ev)
Put an event on the event queue.
static void * os_event_get_arg(struct os_event *ev)
Returns event argument.
static void os_eventq_run(struct os_eventq *evq)
Gets and runs an event from the queue callback.
uint32_t os_time_t
time type
thread_t * waiter
thread owning event queue
clist_node_t event_list
list of queued events
Callback Event structure definition.
event_t super
event_t structure that gets extended
event_handler_t handler
pointer to event handler function
clist_node_t list_node
event queue list entry
struct list_node * next
pointer to next list entry
void * arg
the event argument
event_callback_t e
the event callback
event_queue_t q
the event queue