diff --git a/cpu/native/rtc/posix-rtc.c b/cpu/native/rtc/posix-rtc.c index 614b4573c7fcad82debb43ecb41c1987970260cf..f2d8b88d448c23728778dfc8faf3fcb163177e90 100644 --- a/cpu/native/rtc/posix-rtc.c +++ b/cpu/native/rtc/posix-rtc.c @@ -30,17 +30,24 @@ #include "native_internal.h" static int native_rtc_enabled; +static int native_rtc_initialized; void rtc_init(void) { native_rtc_enabled = 0; + native_rtc_initialized = 1; printf("native rtc initialized\n"); } void rtc_enable(void) { DEBUG("rtc_enable\n"); - native_rtc_enabled = 1; + if (native_rtc_initialized == 1) { + native_rtc_enabled = 1; + } + else { + DEBUG("rtc not initialized, not enabling\n"); + } } void rtc_disable(void)