1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

sys/event/timeout: uninitialized event is not pending

This commit is contained in:
Benjamin Valentin 2024-05-17 14:38:17 +02:00
parent 22dbbf4a07
commit 52350852cc

View File

@ -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);
}