diff options
| author | Joey Castillo <jose.castillo@gmail.com> | 2021-08-28 14:46:58 -0400 | 
|---|---|---|
| committer | Joey Castillo <jose.castillo@gmail.com> | 2021-08-28 14:46:58 -0400 | 
| commit | 52ba3b371022ea5fb0340d156acbb5b02fff5f07 (patch) | |
| tree | 0f41015f7be62b67fb9e431973f59433ca8a70f3 | |
| parent | 39bba27d7dcbe8c22b3f6651f7ae3aa2d6a7c28c (diff) | |
| download | Sensor-Watch-52ba3b371022ea5fb0340d156acbb5b02fff5f07.tar.gz Sensor-Watch-52ba3b371022ea5fb0340d156acbb5b02fff5f07.tar.bz2 Sensor-Watch-52ba3b371022ea5fb0340d156acbb5b02fff5f07.zip  | |
fix buzzer demo, add note about extwake
| -rw-r--r-- | Sensor Watch Buzzer Demo/app.c | 9 | ||||
| -rw-r--r-- | watch-library/watch/watch_extint.h | 2 | 
2 files changed, 2 insertions, 9 deletions
diff --git a/Sensor Watch Buzzer Demo/app.c b/Sensor Watch Buzzer Demo/app.c index 5c2dbc7b..4d378b5c 100644 --- a/Sensor Watch Buzzer Demo/app.c +++ b/Sensor Watch Buzzer Demo/app.c @@ -4,15 +4,12 @@  typedef struct ApplicationState {      bool play; -    bool debounce_wait;  } ApplicationState;  ApplicationState application_state;  void cb_alarm_pressed() { -    if (application_state.debounce_wait) return; -    application_state.debounce_wait = true;      application_state.play = true;  } @@ -24,7 +21,7 @@ void app_wake_from_deep_sleep() {  }  void app_setup() { -    watch_register_button_callback(BTN_ALARM, cb_alarm_pressed); +    watch_register_extwake_callback(BTN_ALARM, cb_alarm_pressed, true);      watch_enable_display(); @@ -129,9 +126,5 @@ bool app_loop() {          }      } -    // Wait a moment to debounce button input -    delay_ms(250); -    application_state.debounce_wait = false; -      return true;  } diff --git a/watch-library/watch/watch_extint.h b/watch-library/watch/watch_extint.h index d1265119..e3084371 100644 --- a/watch-library/watch/watch_extint.h +++ b/watch-library/watch/watch_extint.h @@ -73,7 +73,7 @@ void watch_disable_external_interrupts();    */  void watch_register_interrupt_callback(const uint8_t pin, ext_irq_cb_t callback, watch_interrupt_trigger trigger); -__attribute__((deprecated("Use watch_register_interrupt_callback instead"))) +__attribute__((deprecated("Use watch_register_interrupt_callback or watch_register_extwake_callback instead")))  void watch_register_button_callback(const uint8_t pin, ext_irq_cb_t callback);  __attribute__((deprecated("Use watch_enable_external_interrupts instead")))  | 
