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:
parent
7bc783e7af
commit
7a66f1cc42
@ -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);
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user