]> git.earman.xyz Git - sensor-watch.git/commitdiff
don't force-reset the state of the RTC when rebooting
authorAlessandro Genova <ales.genova@gmail.com>
Mon, 8 Dec 2025 02:09:39 +0000 (21:09 -0500)
committerAlessandro Genova <ales.genova@gmail.com>
Sat, 3 Jan 2026 01:07:56 +0000 (20:07 -0500)
watch-library/hardware/watch/rtc32.c

index 934564bbd94067152dc794e35348a685ccb8725d..d4ac9b27a176692836ae3e4e0786384d34e6e3b8 100644 (file)
@@ -61,9 +61,7 @@ void rtc_init(void) {
     MCLK->APBAMASK.reg |= MCLK_APBAMASK_RTC;
 #endif
 
-    // if (rtc_is_enabled()) return; // don't reset the RTC if it's already set up.
-    // Reset everything, once things are stabilized we can think about preserving some state
-    CTRLREG.bit.ENABLE = 0;
+    if (rtc_is_enabled()) return; // don't reset the RTC if it's already set up.
 
     _rtc_sync();
     CTRLREG.bit.SWRST = 1;