From 2f9b77920da2d06fad6dc3d29faeb82079400e98 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 27 Jan 2020 16:03:14 +0100 Subject: [PATCH] pkg/semtech-loramac: TimerInit(): use static struct initializer Previously, TimerInit() explicitly set some values of the xtimer truct to "0". This commit changes it to use a static struct initializer `(xtimer_t){0}`. The advantage is that now this is independent of the actual xtimer structure. Now this also resets the remaining xtimer fields, but they're properly re-populated elsewhere (by using xtimer_set_msg()). --- pkg/semtech-loramac/contrib/semtech_loramac_timer.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/semtech-loramac/contrib/semtech_loramac_timer.c b/pkg/semtech-loramac/contrib/semtech_loramac_timer.c index 1725262f2d..c77b24d5b4 100644 --- a/pkg/semtech-loramac/contrib/semtech_loramac_timer.c +++ b/pkg/semtech-loramac/contrib/semtech_loramac_timer.c @@ -27,10 +27,7 @@ extern kernel_pid_t semtech_loramac_pid; void TimerInit(TimerEvent_t *obj, void (*cb)(void)) { - obj->dev.start_time = 0; - obj->dev.long_start_time = 0; - obj->dev.offset = 0; - obj->dev.long_offset = 0; + obj->dev = (xtimer_t) { 0 }; obj->running = 0; obj->cb = cb; }