From 0805981776518d2f7f63dc82c87a5e4e32863a56 Mon Sep 17 00:00:00 2001 From: Mouise Date: Sat, 13 Jun 2026 14:11:25 +0200 Subject: [PATCH] added btn press up event --- main/buttons/buttons.c | 3 ++- main/buttons/buttons.h | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main/buttons/buttons.c b/main/buttons/buttons.c index 74207bf..f69d993 100644 --- a/main/buttons/buttons.c +++ b/main/buttons/buttons.c @@ -29,7 +29,7 @@ void button_event_cb(void *arg, void *data) void initialize_buttons(){ const button_config_t btn_cfg = {0}; - button_handle_t btns[5]; + button_handle_t btns[10]; for (size_t i = 0; i < sizeof(actions) / sizeof(actions[0]); i++) { @@ -39,5 +39,6 @@ void initialize_buttons(){ }; ESP_RETURN_VOID_ON_ERROR(iot_button_new_gpio_device(&btn_cfg, &btn_gpio_cfg, &btns[i]), TAG, ""); iot_button_register_cb(btns[i], BUTTON_PRESS_DOWN, NULL, button_event_cb, (void *) &actions[i]); + iot_button_register_cb(btns[i], BUTTON_PRESS_UP, NULL, button_event_cb, (void *) &actions[i]); } } \ No newline at end of file diff --git a/main/buttons/buttons.h b/main/buttons/buttons.h index 92ea30b..d4d6d21 100644 --- a/main/buttons/buttons.h +++ b/main/buttons/buttons.h @@ -20,8 +20,7 @@ typedef struct buttonAction btnAcc; const char* name; char shortcut; - int pin; - + int pin; }action; void button_event_cb(void *arg, void *data);