fix buzzer demo, add note about extwake
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user