summaryrefslogtreecommitdiffstats
path: root/main/fix-wakeup.patch
blob: e3933a200c1189c0639ed0a20ebb08e9aafc2cb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff --git a/movement/movement.c b/movement/movement.c
index ec20ce6..825f130 100644
--- a/movement/movement.c
+++ b/movement/movement.c
@@ -132,7 +132,7 @@ const char movement_valid_position_1_chars[] = " ABCDEFHlJLNORTtUX-='01378";
 void cb_mode_btn_interrupt(void);
 void cb_light_btn_interrupt(void);
 void cb_alarm_btn_interrupt(void);
-void cb_alarm_btn_extwake(void);
+void cb_btn_extwake(void);
 void cb_alarm_fired(void);
 void cb_fast_tick(void);
 void cb_tick(void);
@@ -382,6 +382,8 @@ void app_setup(void) {
     }
     if (movement_state.le_mode_ticks != -1) {
         watch_disable_extwake_interrupt(BTN_ALARM);
+        watch_disable_extwake_interrupt(BTN_LIGHT);
+        watch_disable_extwake_interrupt(BTN_MODE);
 
         watch_enable_external_interrupts();
         watch_register_interrupt_callback(BTN_MODE, cb_mode_btn_interrupt, INTERRUPT_TRIGGER_BOTH);
@@ -464,7 +466,9 @@ bool app_loop(void) {
     // if we have timed out of our low energy mode countdown, enter low energy mode.
     if (movement_state.le_mode_ticks == 0) {
         movement_state.le_mode_ticks = -1;
-        watch_register_extwake_callback(BTN_ALARM, cb_alarm_btn_extwake, true);
+        watch_register_extwake_callback(BTN_ALARM, cb_btn_extwake, true);
+        watch_register_extwake_callback(BTN_MODE, cb_btn_extwake, true);
+        watch_register_extwake_callback(BTN_LIGHT, cb_btn_extwake, true);
         event.event_type = EVENT_NONE;
         event.subsecond = 0;
 
@@ -600,7 +604,7 @@ void cb_alarm_btn_interrupt(void) {
     event.event_type = _figure_out_button_event(pin_level, EVENT_ALARM_BUTTON_DOWN, &movement_state.alarm_down_timestamp);
 }
 
-void cb_alarm_btn_extwake(void) {
+void cb_btn_extwake(void) {
     // wake up!
     _movement_reset_inactivity_countdown();
 }