Update app_main.c

This commit is contained in:
RocketGod
2025-09-06 21:49:46 -07:00
parent 0aacfcde24
commit b3b1fa9c71
+2 -2
View File
@@ -179,8 +179,8 @@ static void field_generator_rainbow_loop(void) {
*/
static void button_pin_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) {
device_mode_t mode = get_device_mode();
// Temporarily allow only the analog card mode to respond to button operations
if (mode == DEVICE_MODE_TAG) {
// Allow button operations in both tag and reader mode
if (mode == DEVICE_MODE_TAG || mode == DEVICE_MODE_READER) {
static nrf_drv_gpiote_pin_t pin_static; // Use static internal variables to store the GPIO where the current event occurred
pin_static = pin; // Cache the button that currently triggers the event into an internal variable
app_timer_start(m_button_check_timer, APP_TIMER_TICKS(50), &pin_static); // Start timer anti-shake