From ef51ea78019db88d23be1b83f3a80b0415a018f9 Mon Sep 17 00:00:00 2001 From: cepetr Date: Wed, 12 Feb 2025 10:54:45 +0100 Subject: [PATCH] fix(core): fix touch activity detection in bootloader [no changelog] --- core/embed/io/touch/ft6x36/ft6x36.c | 2 ++ core/embed/models/T3W1/boards/trezor_t3w1_revA.h | 1 + core/embed/models/T3W1/boards/trezor_t3w1_revA0.h | 1 + core/embed/models/T3W1/boards/trezor_t3w1_revB.h | 1 + 4 files changed, 5 insertions(+) diff --git a/core/embed/io/touch/ft6x36/ft6x36.c b/core/embed/io/touch/ft6x36/ft6x36.c index aa23cbae56..1b6b539480 100644 --- a/core/embed/io/touch/ft6x36/ft6x36.c +++ b/core/embed/io/touch/ft6x36/ft6x36.c @@ -139,6 +139,7 @@ static secbool ft6x36_write_reg(i2c_bus_t* bus, uint8_t reg, uint8_t value) { // To avoid this issue, we need to wake up the controller before // sending any commands to it. static void ft6x36_wake_up(i2c_bus_t* bus) { +#ifdef TOUCH_WAKEUP_WORKAROUND uint8_t temp; // Wake up the touch controller by reading one of its registers // (the specific register does not matter) @@ -146,6 +147,7 @@ static void ft6x36_wake_up(i2c_bus_t* bus) { // Wait for the touch controller to wake up // (not sure if this is necessary, but it's safer to include it) systick_delay_ms(1); +#endif } // Powers down the touch controller and puts all diff --git a/core/embed/models/T3W1/boards/trezor_t3w1_revA.h b/core/embed/models/T3W1/boards/trezor_t3w1_revA.h index 03201c74d4..f95649d9f2 100644 --- a/core/embed/models/T3W1/boards/trezor_t3w1_revA.h +++ b/core/embed/models/T3W1/boards/trezor_t3w1_revA.h @@ -109,6 +109,7 @@ #define I2C_INSTANCE_3_GUARD_TIME 50 #define TOUCH_SENSITIVITY 0x40 +#define TOUCH_WAKEUP_WORKAROUND 1 #define TOUCH_I2C_INSTANCE 2 #define TOUCH_INT_PORT GPIOC #define TOUCH_INT_PIN GPIO_PIN_3 diff --git a/core/embed/models/T3W1/boards/trezor_t3w1_revA0.h b/core/embed/models/T3W1/boards/trezor_t3w1_revA0.h index c305bbc9eb..75d311fc61 100644 --- a/core/embed/models/T3W1/boards/trezor_t3w1_revA0.h +++ b/core/embed/models/T3W1/boards/trezor_t3w1_revA0.h @@ -108,6 +108,7 @@ #define I2C_INSTANCE_3_GUARD_TIME 50 #define TOUCH_SENSITIVITY 0x40 +#define TOUCH_WAKEUP_WORKAROUND 1 #define TOUCH_I2C_INSTANCE 2 #define TOUCH_INT_PORT GPIOC #define TOUCH_INT_PIN GPIO_PIN_3 diff --git a/core/embed/models/T3W1/boards/trezor_t3w1_revB.h b/core/embed/models/T3W1/boards/trezor_t3w1_revB.h index 8ce642c412..1317a58954 100644 --- a/core/embed/models/T3W1/boards/trezor_t3w1_revB.h +++ b/core/embed/models/T3W1/boards/trezor_t3w1_revB.h @@ -109,6 +109,7 @@ #define I2C_INSTANCE_3_GUARD_TIME 50 #define TOUCH_SENSITIVITY 0x40 +#define TOUCH_WAKEUP_WORKAROUND 1 #define TOUCH_I2C_INSTANCE 2 #define TOUCH_INT_PORT GPIOC #define TOUCH_INT_PIN GPIO_PIN_3