]> git.earman.xyz Git - sensor-watch.git/commitdiff
sunrise/set: return home if no location set
authorjoeycastillo <joeycastillo@utexas.edu>
Tue, 29 Nov 2022 19:39:14 +0000 (13:39 -0600)
committerjoeycastillo <joeycastillo@utexas.edu>
Tue, 29 Nov 2022 19:39:14 +0000 (13:39 -0600)
movement/watch_faces/complication/sunrise_sunset_face.c

index 8bc18ddd32b376b475af07ef8df51abfca93fad2..7807de834adde0c11c41c694bbaa395f93b7270e 100644 (file)
@@ -381,8 +381,11 @@ bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *setti
             }
             break;
         case EVENT_TIMEOUT:
-            if (state->page || state->rise_index) {
-                // on timeout, exit settings mode and return to the next sunrise or sunset
+            if (watch_get_backup_data(1) == 0) {
+                // if no location set, return home
+                movement_move_to_face(0);
+            } else if (state->page || state->rise_index) {
+                // otherwise on timeout, exit settings mode and return to the next sunrise or sunset
                 state->page = 0;
                 state->rise_index = 0;
                 movement_request_tick_frequency(1);