diff options
-rw-r--r-- | common/button.c | 10 | ||||
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | util/config_allowed.txt | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/common/button.c b/common/button.c index 284d026285..27cd8ae058 100644 --- a/common/button.c +++ b/common/button.c @@ -849,20 +849,26 @@ struct button_config buttons[BUTTON_COUNT] = { #endif #if defined(CONFIG_DEDICATED_RECOVERY_BUTTON) +#ifndef CONFIG_DEDICATED_RECOVERY_BUTTON_FLAGS +#define CONFIG_DEDICATED_RECOVERY_BUTTON_FLAGS 0 +#endif [BUTTON_RECOVERY] = { .name = "Recovery", .type = KEYBOARD_BUTTON_RECOVERY, .gpio = GPIO_RECOVERY_L, .debounce_us = BUTTON_DEBOUNCE_US, - .flags = 0, + .flags = CONFIG_DEDICATED_RECOVERY_BUTTON_FLAGS, }, #ifdef CONFIG_DEDICATED_RECOVERY_BUTTON_2 +#ifndef CONFIG_DEDICATED_RECOVERY_BUTTON_2_FLAGS +#define CONFIG_DEDICATED_RECOVERY_BUTTON_2_FLAGS 0 +#endif [BUTTON_RECOVERY_2] = { .name = "Recovery2", .type = KEYBOARD_BUTTON_RECOVERY, .gpio = GPIO_RECOVERY_L_2, .debounce_us = BUTTON_DEBOUNCE_US, - .flags = 0, + .flags = CONFIG_DEDICATED_RECOVERY_BUTTON_2_FLAGS, } #endif /* defined(CONFIG_DEDICATED_RECOVERY_BUTTON_2) */ #endif /* defined(CONFIG_DEDICATED_RECOVERY_BUTTON) */ diff --git a/include/config.h b/include/config.h index 57e48fc059..f9dee49661 100644 --- a/include/config.h +++ b/include/config.h @@ -846,6 +846,10 @@ #undef CONFIG_DEDICATED_RECOVERY_BUTTON #undef CONFIG_DEDICATED_RECOVERY_BUTTON_2 +/* Configure recovery button. e.g. BUTTON_FLAG_ACTIVE_HIGH */ +#undef CONFIG_DEDICATED_RECOVERY_BUTTON_FLAGS +#undef CONFIG_DEDICATED_RECOVERY_BUTTON_2_FLAGS + /* * RISC-V core specific panic data is bigger than Cortex-M core specific panic * data. Including this into union in panic_data structure causes whole diff --git a/util/config_allowed.txt b/util/config_allowed.txt index 211db546d4..7fa6ba652f 100644 --- a/util/config_allowed.txt +++ b/util/config_allowed.txt @@ -340,6 +340,8 @@ CONFIG_DEBUG_STACK_OVERFLOW CONFIG_DEDICATED_CHARGE_PORT_COUNT CONFIG_DEDICATED_RECOVERY_BUTTON CONFIG_DEDICATED_RECOVERY_BUTTON_2 +CONFIG_DEDICATED_RECOVERY_BUTTON_2_FLAGS +CONFIG_DEDICATED_RECOVERY_BUTTON_FLAGS CONFIG_DELAY_DSW_PWROK_TO_PWRBTN CONFIG_DETACHABLE_BASE CONFIG_DEVICE_EVENT |