]> git.earman.xyz Git - sensor-watch.git/commitdiff
move git hash to end of settings
authorJoey Castillo <joeycastillo@utexas.edu>
Sun, 6 Jul 2025 15:27:05 +0000 (11:27 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Sun, 6 Jul 2025 15:27:23 +0000 (11:27 -0400)
watch-faces/settings/settings_face.c
watch-faces/settings/settings_face.h

index 10aef50830f1322529d8c136e861c018dc24e34f..0894ebe53ef100789f9c8b94f4a4a4eb027b696f 100644 (file)
@@ -263,11 +263,6 @@ void settings_face_setup(uint8_t watch_face_index, void ** context_ptr) {
         state->settings_screens[current_setting].display = low_energy_setting_display;
         state->settings_screens[current_setting].advance = low_energy_setting_advance;
         current_setting++;
-#endif
-#ifdef BUILD_GIT_HASH
-        state->settings_screens[current_setting].display = git_hash_setting_display;
-        state->settings_screens[current_setting].advance = git_hash_setting_advance;
-        current_setting++;
 #endif
         state->settings_screens[current_setting].display = led_duration_setting_display;
         state->settings_screens[current_setting].advance = led_duration_setting_advance;
@@ -296,6 +291,12 @@ void settings_face_setup(uint8_t watch_face_index, void ** context_ptr) {
 #else
         (void)blue_led_setting_display;
         (void)blue_led_setting_advance;
+#endif
+    state->led_color_end = current_setting;
+#ifdef BUILD_GIT_HASH
+        state->settings_screens[current_setting].display = git_hash_setting_display;
+        state->settings_screens[current_setting].advance = git_hash_setting_advance;
+        current_setting++;
 #endif
     }
 }
@@ -332,7 +333,7 @@ bool settings_face_loop(movement_event_t event, void *context) {
             return movement_default_loop_handler(event);
     }
 
-    if (state->current_page >= state->led_color_start) {
+    if (state->current_page >= state->led_color_start && state->current_page < state->led_color_end) {
         movement_color_t color = movement_backlight_color();
         // this bitwise math turns #000 into #000000, #111 into #111111, etc.
         movement_force_led_on(color.red | color.red << 4,
index 26a31d5d650c9f8e3f3799fa0775a56caf77c916..49e96b98811350fcac4991146aecafb79400ef9a 100644 (file)
@@ -81,6 +81,7 @@ typedef struct {
     int8_t current_page;
     int8_t num_settings;
     int8_t led_color_start;
+    int8_t led_color_end;
     settings_screen_t *settings_screens;
 } settings_state_t;