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

event_timeout: check clock before removing ztimer on clear

This commit is contained in:
Martine Lenders 2021-07-21 13:30:54 +02:00
parent 4f905bfa8c
commit 8924077a25
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80

View File

@ -60,7 +60,9 @@ void event_timeout_set(event_timeout_t *event_timeout, uint32_t timeout)
void event_timeout_clear(event_timeout_t *event_timeout)
{
#if IS_USED(MODULE_EVENT_TIMEOUT_ZTIMER)
ztimer_remove(event_timeout->clock, &event_timeout->timer);
if (event_timeout->clock) {
ztimer_remove(event_timeout->clock, &event_timeout->timer);
}
#else
xtimer_remove(&event_timeout->timer);
#endif