]> git.earman.xyz Git - sensor-watch.git/commitdiff
rename needs_advisories_handled to woke_from_alarm_handler
authorjoeycastillo <joeycastillo@utexas.edu>
Wed, 2 Oct 2024 11:52:10 +0000 (07:52 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Wed, 2 Oct 2024 11:52:10 +0000 (07:52 -0400)
movement.c
movement.h

index 08d31dba19d40754ae6de81060e970513969b34a..27d55e4250b25c3780e9f7a3b3dd904d30ecdbda 100644 (file)
@@ -109,7 +109,7 @@ static void _movement_handle_advisories(void) {
             // TODO: handle other advisory types
         }
     }
-    movement_state.needs_advisories_handled = false;
+    movement_state.woke_from_alarm_handler = false;
 }
 
 static void _movement_handle_scheduled_tasks(void) {
@@ -547,7 +547,7 @@ static void _sleep_mode_app_loop(void) {
     // as long as le_mode_ticks is -1 (i.e. we are in low energy mode), we wake up here, update the screen, and go right back to sleep.
     while (movement_state.le_mode_ticks == -1) {
         // we also have to handle background tasks here in the mini-runloop
-        if (movement_state.needs_advisories_handled) _movement_handle_advisories();
+        if (movement_state.woke_from_alarm_handler) _movement_handle_advisories();
 
         event.event_type = EVENT_LOW_ENERGY_UPDATE;
         watch_faces[movement_state.current_face_idx].loop(event, watch_face_contexts[movement_state.current_face_idx]);
@@ -590,7 +590,7 @@ bool app_loop(void) {
     }
 
     // handle advisories, if the alarm handler told us we need to
-    if (movement_state.needs_advisories_handled) _movement_handle_advisories();
+    if (movement_state.woke_from_alarm_handler) _movement_handle_advisories();
 
     // if we have a scheduled background task, handle that here:
     if (event.event_type == EVENT_TICK && movement_state.has_scheduled_background_task) _movement_handle_scheduled_tasks();
@@ -748,7 +748,7 @@ void cb_alarm_btn_extwake(void) {
 }
 
 void cb_alarm_fired(void) {
-    movement_state.needs_advisories_handled = true;
+    movement_state.woke_from_alarm_handler = true;
 }
 
 void cb_fast_tick(void) {
index c250dd9d1c7889f08e428aafb6f186ab2642a43b..d024179c70f5051ea27d51b07e4015e7c2510a23 100644 (file)
@@ -130,6 +130,7 @@ typedef enum {
     EVENT_LOW_ENERGY_UPDATE,    // If the watch is in low energy mode and you are in the foreground, you will get a chance to update the display once per minute.
     EVENT_BACKGROUND_TASK,      // Your watch face is being invoked to perform a background task. Don't update the display here; you may not be in the foreground.
     EVENT_TIMEOUT,              // Your watch face has been inactive for a while. You may want to resign, depending on your watch face's intended use case.
+
     EVENT_LIGHT_BUTTON_DOWN,    // The light button has been pressed, but not yet released.
     EVENT_LIGHT_BUTTON_UP,      // The light button was pressed for less than half a second, and released.
     EVENT_LIGHT_LONG_PRESS,     // The light button was held for over half a second, but not yet released.
@@ -279,7 +280,7 @@ typedef struct {
     uint16_t alarm_down_timestamp;
 
     // background task handling
-    bool needs_advisories_handled;
+    bool woke_from_alarm_handler;
     bool has_scheduled_background_task;
     bool needs_wake;