Skip to content
Snippets Groups Projects
Commit 03dccb56 authored by Hauke Petersen's avatar Hauke Petersen
Browse files

sys/event/timeout: add timeout_clear() function

parent 2f4a7e28
No related branches found
No related tags found
No related merge requests found
......@@ -26,3 +26,8 @@ void event_timeout_set(event_timeout_t *event_timeout, uint32_t timeout)
{
xtimer_set(&event_timeout->timer, timeout);
}
void event_timeout_clear(event_timeout_t *event_timeout)
{
xtimer_remove(&event_timeout->timer);
}
......@@ -74,6 +74,18 @@ void event_timeout_init(event_timeout_t *event_timeout, event_queue_t *queue, ev
*/
void event_timeout_set(event_timeout_t *event_timeout, uint32_t timeout);
/**
* @brief Clear a timeout event
*
* Calling this function will cancel the timeout by removing its underlying
* timer. If the timer has already fired before calling this function, the
* connected event will be put already into the given event queue and this
* function does not have any effect.
*
* @param[in] event_timeout event_timeout context object to use
*/
void event_timeout_clear(event_timeout_t *event_timeout);
#ifdef __cplusplus
}
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment