diff --git a/core/embed/io/button/stm32/button.c b/core/embed/io/button/stm32/button.c index 55cdfc65e3..c80bcea958 100644 --- a/core/embed/io/button/stm32/button.c +++ b/core/embed/io/button/stm32/button.c @@ -21,6 +21,11 @@ #include #include +#include + +#ifdef USE_POWERCTL +#include +#endif #ifdef KERNEL_MODE @@ -89,7 +94,7 @@ bool button_init(void) { EXTI_Config.Trigger = EXTI_TRIGGER_FALLING; HAL_EXTI_SetConfigLine(&EXTI_Handle, &EXTI_Config); NVIC_SetPriority(BTN_EXTI_INTERRUPT_NUM, IRQ_PRI_NORMAL); - __HAL_GPIO_EXTI_CLEAR_FLAG(BTN_INT_PIN); + __HAL_GPIO_EXTI_CLEAR_FLAG(BTN_EXTI_INTERRUPT_PIN); NVIC_EnableIRQ(BTN_EXTI_INTERRUPT_NUM); #endif // BTN_EXTI_INTERRUPT_HANDLER @@ -180,10 +185,12 @@ void BTN_EXTI_INTERRUPT_HANDLER(void) { // button_driver_t *drv = &g_button_driver; // Clear the EXTI line pending bit - __HAL_GPIO_EXTI_CLEAR_FLAG(BTN_INT_PIN); + __HAL_GPIO_EXTI_CLEAR_FLAG(BTN_EXTI_INTERRUPT_PIN); +#ifdef USE_POWERCTL // Inform the powerctl module about button press - // wakeup_flags_set(WAKEUP_FLAGS_BUTTON); + wakeup_flags_set(WAKEUP_FLAG_BUTTON); +#endif } #endif diff --git a/core/embed/models/T3W1/boards/trezor_t3w1_revA.h b/core/embed/models/T3W1/boards/trezor_t3w1_revA.h index c7ab40e650..f3726b61ca 100644 --- a/core/embed/models/T3W1/boards/trezor_t3w1_revA.h +++ b/core/embed/models/T3W1/boards/trezor_t3w1_revA.h @@ -6,6 +6,11 @@ #define BTN_POWER_PIN GPIO_PIN_5 #define BTN_POWER_PORT GPIOE #define BTN_POWER_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE +#define BTN_EXTI_INTERRUPT_GPIOSEL EXTI_GPIOE +#define BTN_EXTI_INTERRUPT_LINE EXTI_LINE_5 +#define BTN_EXTI_INTERRUPT_PIN GPIO_PIN_5 +#define BTN_EXTI_INTERRUPT_NUM EXTI5_IRQn +#define BTN_EXTI_INTERRUPT_HANDLER EXTI5_IRQHandler #define DISPLAY_COLOR_MODE DMA2D_OUTPUT_RGB565