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;
}
}
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();
}
}
- // Wait a moment to debounce button input
- delay_ms(250);
- application_state.debounce_wait = false;
-
return true;
}
*/
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")))