mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #20870 from derMihai/mir/event_timeout_zero
event/timeout: event_timeout_set() enqueues immediately if timeout is zero
This commit is contained in:
commit
7f959f83cc
@ -38,7 +38,11 @@ void event_timeout_ztimer_init(event_timeout_t *event_timeout, ztimer_clock_t *c
|
||||
|
||||
void event_timeout_set(event_timeout_t *event_timeout, uint32_t timeout)
|
||||
{
|
||||
ztimer_set(event_timeout->clock, &event_timeout->timer, timeout);
|
||||
if (timeout == 0) {
|
||||
event_post(event_timeout->queue, event_timeout->event);
|
||||
} else {
|
||||
ztimer_set(event_timeout->clock, &event_timeout->timer, timeout);
|
||||
}
|
||||
}
|
||||
|
||||
void event_timeout_clear(event_timeout_t *event_timeout)
|
||||
|
Loading…
Reference in New Issue
Block a user