diff --git a/sys/ztimer/periph_rtc.c b/sys/ztimer/periph_rtc.c index 68656ea7b2..7144706d1a 100644 --- a/sys/ztimer/periph_rtc.c +++ b/sys/ztimer/periph_rtc.c @@ -46,7 +46,7 @@ static uint32_t _gmt_civil_to_timestamp(unsigned y, unsigned m, unsigned d, 719561) * 86400 + 3600 * h + 60 * mi + s; } -void _timestamp_to_gmt_civil(struct tm *_tm, uint32_t epoch) +static void _timestamp_to_gmt_civil(struct tm *_tm, uint32_t epoch) { uint32_t s = epoch % 86400; @@ -88,7 +88,7 @@ static uint32_t _ztimer_periph_rtc_now(ztimer_clock_t *clock) { (void)clock; - struct tm time; + struct tm time = { .tm_year = 0 }; rtc_get_time(&time); @@ -110,7 +110,7 @@ static void _ztimer_periph_rtc_set(ztimer_clock_t *clock, uint32_t val) target = now + val; - struct tm _tm; + struct tm _tm = { .tm_year = 0 }; _timestamp_to_gmt_civil(&_tm, target); /* TODO: ensure this doesn't underflow */