]> git.earman.xyz Git - sensor-watch.git/commitdiff
set date first, then time zone, then time
authorJoey Castillo <joeycastillo@utexas.edu>
Fri, 16 May 2025 02:49:07 +0000 (22:49 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Fri, 16 May 2025 02:49:07 +0000 (22:49 -0400)
watch-faces/settings/set_time_face.c

index d3aee1693e12294a0574e441c8d9176d5072322b..a580d6b6d3dbc61a455a208378be265ed65de82b 100644 (file)
@@ -30,8 +30,8 @@
 #include "zones.h"
 
 #define SET_TIME_FACE_NUM_SETTINGS (7)
-const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][6] = {"     ", "Year ", "Month", "Day  ", "Hour ", "Minut", "Secnd"};
-const char set_time_face_fallback_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"  ", "YR", "MO", "DA", "HR", "M1", "SE"};
+const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][6] = {"Year ", "Month", "Day  ", "     ", "Hour ", "Minut", "Secnd"};
+const char set_time_face_fallback_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"YR", "MO", "DA", "  ", "HR", "M1", "SE"};
 
 static bool _quick_ticks_running;
 static int32_t current_offset;
@@ -40,18 +40,18 @@ static void _handle_alarm_button(watch_date_time_t date_time, uint8_t current_pa
     // handles short or long pressing of the alarm button
 
     switch (current_page) {
-        case 0: // time zone
+        case 3: // time zone
             movement_set_timezone_index(movement_get_timezone_index() + 1);
             if (movement_get_timezone_index() >= NUM_ZONE_NAMES) movement_set_timezone_index(0);
             current_offset = movement_get_current_timezone_offset_for_zone(movement_get_timezone_index());
             break;
-        case 1: // year
+        case 0: // year
             date_time.unit.year = ((date_time.unit.year % 60) + 1);
             break;
-        case 2: // month
+        case 1: // month
             date_time.unit.month = (date_time.unit.month % 12) + 1;
             break;
-        case 3: { // day
+        case 2: { // day
             date_time.unit.day = (date_time.unit.day % watch_utility_days_in_month(date_time.unit.month, date_time.unit.year + WATCH_RTC_REFERENCE_YEAR)) + 1;
             break;
         case 4: // hour
@@ -130,7 +130,7 @@ bool set_time_face_loop(movement_event_t event, void *context) {
     char buf[11];
     watch_display_text(WATCH_POSITION_TOP_RIGHT, "  ");
     watch_display_text_with_fallback(WATCH_POSITION_TOP, (char *) set_time_face_titles[current_page], (char *) set_time_face_fallback_titles[current_page]);
-    if (current_page < 1) {
+    if (current_page == 3) {
         watch_display_text(WATCH_POSITION_TOP_RIGHT, " Z");
         if (current_offset < 0) watch_display_text(WATCH_POSITION_TOP_LEFT, "- ");
         else watch_display_text(WATCH_POSITION_TOP_LEFT, "* ");
@@ -144,7 +144,7 @@ bool set_time_face_loop(movement_event_t event, void *context) {
             sprintf(buf, "%s", watch_utility_time_zone_name_at_index(movement_get_timezone_index()));
             watch_clear_colon();
         }
-    } else if (current_page < 4) {
+    } else if (current_page < 3) {
         watch_clear_colon();
         watch_clear_indicator(WATCH_INDICATOR_24H);
         watch_clear_indicator(WATCH_INDICATOR_PM);
@@ -166,15 +166,15 @@ bool set_time_face_loop(movement_event_t event, void *context) {
     // blink up the parameter we're setting
     if (event.subsecond % 2 && !_quick_ticks_running) {
         switch (current_page) {
-            case 1:
+            case 0:
             case 4:
                 watch_display_text(WATCH_POSITION_HOURS, "  ");
                 break;
-            case 2:
+            case 1:
             case 5:
                 watch_display_text(WATCH_POSITION_MINUTES, "  ");
                 break;
-            case 3:
+            case 2:
             case 6:
                 watch_display_text(WATCH_POSITION_SECONDS, "  ");
                 break;