]> git.earman.xyz Git - sensor-watch.git/commitdiff
movement: only run custom commands at first launch
authorJoey Castillo <joeycastillo@utexas.edu>
Thu, 21 Apr 2022 19:37:12 +0000 (15:37 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Thu, 21 Apr 2022 19:37:12 +0000 (15:37 -0400)
movement/alt_fw/the_stargazer.h
movement/movement.c

index edf49ffa44b93cdf596e464df430b60ec673761c..50a89aad538f67b4029d396307a8508d48d970d8 100644 (file)
@@ -30,6 +30,7 @@
 #define MOVEMENT_CUSTOM_BOOT_COMMANDS() { \
     movement_state.settings.bit.led_green_color = 0x0;\
     movement_state.settings.bit.led_red_color = 0xF;\
+    watch_store_backup_data(movement_state.settings.reg, 0);\
 }
 
 const watch_face_t watch_faces[] = {
index c3beec874f1430eb0ccf700faa7955cb45f016d9..4a5bc04e51e199456e2b8d1bd852da65cc490b3b 100644 (file)
@@ -268,15 +268,15 @@ void app_wake_from_backup(void) {
 }
 
 void app_setup(void) {
-    #ifdef MOVEMENT_CUSTOM_BOOT_COMMANDS
-    MOVEMENT_CUSTOM_BOOT_COMMANDS()
-    #endif
-
     watch_store_backup_data(movement_state.settings.reg, 0);
 
     static bool is_first_launch = true;
 
     if (is_first_launch) {
+        #ifdef MOVEMENT_CUSTOM_BOOT_COMMANDS
+        MOVEMENT_CUSTOM_BOOT_COMMANDS()
+        #endif
+
         for(uint8_t i = 0; i < MOVEMENT_NUM_FACES; i++) {
             watch_face_contexts[i] = NULL;
             scheduled_tasks[i].reg = 0;