1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/event/timeout: add event_timeout_is_pending()

This commit is contained in:
Benjamin Valentin 2023-10-04 13:21:05 +02:00 committed by Benjamin Valentin
parent 7bc783e7af
commit 7a66f1cc42

View File

@ -107,6 +107,18 @@ void event_timeout_set(event_timeout_t *event_timeout, uint32_t timeout);
*/
void event_timeout_clear(event_timeout_t *event_timeout);
/**
* @brief Check if a timeout event is scheduled to be executed in the future
*
* @param[in] event_timeout event_timout context object to use
* @return true if the event is scheduled, false otherwise
*/
static inline bool event_timeout_is_pending(const event_timeout_t *event_timeout)
{
return ztimer_is_set(event_timeout->clock, &event_timeout->timer)
|| event_is_queued(event_timeout->queue, event_timeout->event);
}
#ifdef __cplusplus
}
#endif