Skip to content

Commit

Permalink
fix(core): fix touch activity detection in bootloader
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
cepetr committed Feb 13, 2025
1 parent 850b52c commit ef51ea7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/embed/io/touch/ft6x36/ft6x36.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ 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)
ft6x36_read_regs(bus, 0x00, &temp, 1);
// 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
Expand Down
1 change: 1 addition & 0 deletions core/embed/models/T3W1/boards/trezor_t3w1_revA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions core/embed/models/T3W1/boards/trezor_t3w1_revA0.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions core/embed/models/T3W1/boards/trezor_t3w1_revB.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef51ea7

Please sign in to comment.