]> git.earman.xyz Git - sensor-watch.git/commitdiff
Moon face and Activity face loop
authorDavid Volovskiy <devolov@gmail.com>
Tue, 19 Aug 2025 00:42:22 +0000 (20:42 -0400)
committerDavid Volovskiy <devolov@gmail.com>
Tue, 19 Aug 2025 12:42:57 +0000 (08:42 -0400)
watch-faces/complication/moon_phase_face.c
watch-faces/sensor/activity_logging_face.c

index 9e9591d3af9b1dad6710c556cb1253852eb3c859..c7a550dc6ea87c294354bbda0da6b2d6f90167eb 100644 (file)
@@ -184,10 +184,19 @@ bool moon_phase_face_loop(movement_event_t event, void *context) {
             state->offset += 86400;
             _update(state, state->offset);
             break;
-       case EVENT_ALARM_LONG_PRESS:
-           state->offset = 0;
+           case EVENT_ALARM_LONG_PRESS:
+               state->offset = 0;
             _update(state, state->offset);
-           break;
+               break;
+        case EVENT_LIGHT_BUTTON_DOWN:
+            break;
+        case EVENT_LIGHT_BUTTON_UP:
+            state->offset -= 86400;
+            _update(state, state->offset);
+            break;
+        case EVENT_LIGHT_LONG_PRESS:
+            movement_illuminate_led();
+            break;
         case EVENT_TIMEOUT:
             // QUESTION: Should timeout reset offset to 0?
             break;
index 3d5eb1cf6da19735d63c6e4c27e6650f52458d3d..65d717f1964699aa44691c0a92cdfe60e0d2ac04 100644 (file)
@@ -86,6 +86,13 @@ void activity_logging_face_activate(void *context) {
 bool activity_logging_face_loop(movement_event_t event, void *context) {
     activity_logging_state_t *state = (activity_logging_state_t *)context;
     switch (event.event_type) {
+        case EVENT_LIGHT_LONG_PRESS:
+            movement_illuminate_led();
+            break;
+        case EVENT_LIGHT_BUTTON_DOWN:
+            state->display_index = (state->display_index + ACTIVITY_LOGGING_NUM_DAYS - 1) % ACTIVITY_LOGGING_NUM_DAYS;
+            _activity_logging_face_update_display(state);
+            break;
         case EVENT_ALARM_BUTTON_DOWN:
             state->display_index = (state->display_index + 1) % ACTIVITY_LOGGING_NUM_DAYS;
             // fall through