diff --git a/core/embed/trezorhal/stm32f4/touch/stmpe811.c b/core/embed/trezorhal/stm32f4/touch/stmpe811.c index 05a6f5572..48efee076 100644 --- a/core/embed/trezorhal/stm32f4/touch/stmpe811.c +++ b/core/embed/trezorhal/stm32f4/touch/stmpe811.c @@ -25,7 +25,7 @@ #include "common.h" #include "secbool.h" -#include "i2c.h" +#include "i2c_bus.h" #include "stmpe811.h" #include "touch.h" @@ -180,10 +180,7 @@ uint32_t I2cxTimeout = I2Cx_TIMEOUT_MAX; /*initialized != sectrue) { + i2c_bus = i2c_bus_open(TOUCH_I2C_INSTANCE); + if (i2c_bus == NULL) { + return secfalse; + } + stmpe811_Reset(); touch_set_mode(); @@ -589,6 +637,7 @@ void touch_deinit(void) { if (driver->initialized == sectrue) { // Not implemented properly + i2c_bus_close(i2c_bus); memset(driver, 0, sizeof(touch_driver_t)); } }