1
0
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:
benpicco 2024-09-25 13:26:38 +00:00 committed by GitHub
commit 7f959f83cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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