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

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()).
This commit is contained in:
Kaspar Schleiser 2020-01-27 16:03:14 +01:00
parent 9800b7bf2c
commit 2f9b77920d

View File

@ -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;
}