Skip to content

Commit

Permalink
sys/event/timeout: uninitialized event is not pending
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed May 17, 2024
1 parent 50e6165 commit de8292e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sys/include/event/timeout.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ void event_timeout_clear(event_timeout_t *event_timeout);
*/
static inline bool event_timeout_is_pending(const event_timeout_t *event_timeout)
{
if (event_timeout->clock == NULL || event_timeout->queue == NULL ||
event_timeout->event == NULL) {
return false;
}

return ztimer_is_set(event_timeout->clock, &event_timeout->timer)
|| event_is_queued(event_timeout->queue, event_timeout->event);
}
Expand Down

0 comments on commit de8292e

Please sign in to comment.