diff --git a/core/embed/io/touch/ft6x36/ft6x36.c b/core/embed/io/touch/ft6x36/ft6x36.c index f34a4f48ac..07b929d401 100644 --- a/core/embed/io/touch/ft6x36/ft6x36.c +++ b/core/embed/io/touch/ft6x36/ft6x36.c @@ -24,7 +24,6 @@ #include #include -#include #include #include "ft6x36.h" @@ -36,10 +35,9 @@ #include "panels/lx250a2410a.h" #endif -#include "../touch_fsm.h" +#include "../touch_poll.h" // #define TOUCH_TRACE_REGS -// #define TOUCH_TRACE_EVENT typedef struct { // Set if the driver is initialized @@ -55,8 +53,6 @@ typedef struct { uint32_t read_ticks; // Last reported touch state uint32_t state; - // Touch state machine for each task - touch_fsm_t tls[SYSTASK_MAX_TASKS]; } touch_driver_t; @@ -65,9 +61,6 @@ static touch_driver_t g_touch_driver = { .initialized = secfalse, }; -// Forward declarations -static const syshandle_vmt_t g_touch_handle_vmt; - // Reads a subsequent registers from the FT6X36. // // Returns: `sectrue` if the register was read @@ -321,7 +314,7 @@ secbool touch_init(void) { goto cleanup; } - if (!syshandle_register(SYSHANDLE_TOUCH, &g_touch_handle_vmt, driver)) { + if (!touch_poll_init()) { goto cleanup; } @@ -338,7 +331,7 @@ cleanup: void touch_deinit(void) { touch_driver_t* driver = &g_touch_driver; - syshandle_unregister(SYSHANDLE_TOUCH); + touch_poll_deinit(); i2c_bus_close(driver->i2c_bus); if (sectrue == driver->initialized) { ft6x36_power_down(); @@ -455,28 +448,15 @@ void trace_regs(uint8_t* regs) { } #endif -#ifdef TOUCH_TRACE_EVENT -void trace_event(uint32_t event) { - char event_type = (event & TOUCH_START) ? 'D' - : (event & TOUCH_MOVE) ? 'M' - : (event & TOUCH_END) ? 'U' - : '-'; - - uint16_t x = touch_unpack_x(event); - uint16_t y = touch_unpack_y(event); - - uint32_t time = hal_ticks_ms() % 10000; - - systask_id_t task_id = systask_id(systask_active()); - - printf("%04ld [task=%d, event=%c, x=%3d, y=%3d]\r\n", time, task_id, - event_type, x, y); -} -#endif - // Reads touch registers and returns the last touch event // (state of touch registers) the controller is reporting. -static uint32_t touch_get_state(touch_driver_t* driver) { +uint32_t touch_get_state(void) { + touch_driver_t* driver = &g_touch_driver; + + if (sectrue != driver->initialized) { + return 0; + } + // Content of registers 0x00 - 0x06 read from the touch controller uint8_t regs[7]; @@ -553,59 +533,4 @@ static uint32_t touch_get_state(touch_driver_t* driver) { return driver->state; } -uint32_t touch_get_event(void) { - touch_driver_t* driver = &g_touch_driver; - - if (sectrue != driver->initialized) { - return 0; - } - - touch_fsm_t* fsm = &driver->tls[systask_id(systask_active())]; - - uint32_t touch_state = touch_get_state(driver); - - uint32_t event = touch_fsm_get_event(fsm, touch_state); - -#ifdef TOUCH_TRACE_EVENT - trace_event(event); -#endif - - return event; -} - -static void on_task_created(void* context, systask_id_t task_id) { - touch_driver_t* driver = (touch_driver_t*)context; - touch_fsm_t* fsm = &driver->tls[task_id]; - touch_fsm_init(fsm); -} - -static void on_event_poll(void* context, bool read_awaited, - bool write_awaited) { - touch_driver_t* driver = (touch_driver_t*)context; - UNUSED(write_awaited); - - if (read_awaited) { - uint32_t touch_state = touch_get_state(driver); - syshandle_signal_read_ready(SYSHANDLE_TOUCH, &touch_state); - } -} - -static bool on_check_read_ready(void* context, systask_id_t task_id, - void* param) { - touch_driver_t* driver = (touch_driver_t*)context; - touch_fsm_t* fsm = &driver->tls[task_id]; - - uint32_t touch_state = *(uint32_t*)param; - - return touch_fsm_event_ready(fsm, touch_state); -} - -static const syshandle_vmt_t g_touch_handle_vmt = { - .task_created = on_task_created, - .task_killed = NULL, - .check_read_ready = on_check_read_ready, - .check_write_ready = NULL, - .poll = on_event_poll, -}; - #endif // KERNEL_MODE diff --git a/core/embed/io/touch/inc/io/touch.h b/core/embed/io/touch/inc/io/touch.h index 2f99187dc5..94f884512e 100644 --- a/core/embed/io/touch/inc/io/touch.h +++ b/core/embed/io/touch/inc/io/touch.h @@ -73,6 +73,8 @@ secbool touch_set_sensitivity(uint8_t value); // The function should not be used together with `touch_get_event()`. secbool touch_activity(void); +uint32_t touch_get_state(void); + #endif // KERNEL_MODE // Returns the last event in packed 32-bit format diff --git a/core/embed/io/touch/sitronix/touch.c b/core/embed/io/touch/sitronix/touch.c index 728f32fdb7..f3a7404e31 100644 --- a/core/embed/io/touch/sitronix/touch.c +++ b/core/embed/io/touch/sitronix/touch.c @@ -22,9 +22,8 @@ #include #include -#include -#include "../touch_fsm.h" +#include "../touch_poll.h" #include "sitronix.h" // Touch driver @@ -33,8 +32,6 @@ typedef struct { secbool initialized; // Last reported touch state uint32_t state; - // Touch state machine for each task - touch_fsm_t tls[SYSTASK_MAX_TASKS]; } touch_driver_t; @@ -43,9 +40,6 @@ static touch_driver_t g_touch_driver = { .initialized = secfalse, }; -// Forward declarations -static const syshandle_vmt_t g_touch_handle_vmt; - secbool touch_init(void) { touch_driver_t* drv = &g_touch_driver; @@ -66,7 +60,7 @@ secbool touch_init(void) { goto cleanup; } - if (!syshandle_register(SYSHANDLE_TOUCH, &g_touch_handle_vmt, drv)) { + if (!touch_poll_init()) { goto cleanup; } @@ -82,7 +76,7 @@ void touch_deinit(void) { touch_driver_t* drv = &g_touch_driver; BSP_TS_DeInit(0); - syshandle_unregister(SYSHANDLE_TOUCH); + touch_poll_deinit(); memset(drv, 0, sizeof(touch_driver_t)); } @@ -119,7 +113,13 @@ secbool touch_activity(void) { return sitronix_touching ? sectrue : secfalse; } -static uint32_t touch_get_state(touch_driver_t* drv) { +uint32_t touch_get_state(void) { + touch_driver_t* drv = &g_touch_driver; + + if (sectrue != drv->initialized) { + return 0; + } + TS_State_t ts = {0}; BSP_TS_GetState(0, &ts); @@ -153,58 +153,4 @@ static uint32_t touch_get_state(touch_driver_t* drv) { return state; } -uint32_t touch_get_event(void) { - touch_driver_t* drv = &g_touch_driver; - - if (sectrue != drv->initialized) { - return 0; - } - - touch_fsm_t* fsm = &drv->tls[systask_id(systask_active())]; - - uint32_t touch_state = touch_get_state(drv); - - uint32_t event = touch_fsm_get_event(fsm, touch_state); - - return event; -} - -static void on_task_created(void* context, systask_id_t task_id) { - touch_driver_t* drv = (touch_driver_t*)context; - touch_fsm_t* fsm = &drv->tls[task_id]; - touch_fsm_init(fsm); -} - -static void on_event_poll(void* context, bool read_awaited, - bool write_awaited) { - touch_driver_t* drv = (touch_driver_t*)context; - - UNUSED(write_awaited); - - if (read_awaited) { - uint32_t touch_state = touch_get_state(drv); - if (touch_state != 0) { - syshandle_signal_read_ready(SYSHANDLE_TOUCH, &touch_state); - } - } -} - -static bool on_check_read_ready(void* context, systask_id_t task_id, - void* param) { - touch_driver_t* drv = (touch_driver_t*)context; - touch_fsm_t* fsm = &drv->tls[task_id]; - - uint32_t touch_state = *(uint32_t*)param; - - return touch_fsm_event_ready(fsm, touch_state); -} - -static const syshandle_vmt_t g_touch_handle_vmt = { - .task_created = on_task_created, - .task_killed = NULL, - .check_read_ready = on_check_read_ready, - .check_write_ready = NULL, - .poll = on_event_poll, -}; - #endif // KERNEL_MODE diff --git a/core/embed/io/touch/stmpe811/touch.c b/core/embed/io/touch/stmpe811/touch.c index 78b647cd19..54f60ee5fc 100644 --- a/core/embed/io/touch/stmpe811/touch.c +++ b/core/embed/io/touch/stmpe811/touch.c @@ -23,9 +23,8 @@ #ifdef KERNEL_MODE #include -#include -#include "../touch_fsm.h" +#include "../touch_poll.h" #include "stmpe811.h" typedef struct { @@ -35,8 +34,6 @@ typedef struct { i2c_bus_t* i2c_bus; // Last reported touch state uint32_t state; - // Touch state machine for each task - touch_fsm_t tls[SYSTASK_MAX_TASKS]; } touch_driver_t; @@ -45,9 +42,6 @@ static touch_driver_t g_touch_driver = { .initialized = secfalse, }; -// Forward declarations -static const syshandle_vmt_t g_touch_handle_vmt; - secbool touch_init(void) { touch_driver_t* drv = &g_touch_driver; @@ -63,7 +57,7 @@ secbool touch_init(void) { goto cleanup; } - if (!syshandle_register(SYSHANDLE_TOUCH, &g_touch_handle_vmt, drv)) { + if (!touch_poll_init()) { goto cleanup; } @@ -81,7 +75,7 @@ cleanup: void touch_deinit(void) { touch_driver_t* drv = &g_touch_driver; - syshandle_unregister(SYSHANDLE_TOUCH); + touch_poll_deinit(); i2c_bus_close(drv->i2c_bus); memset(drv, 0, sizeof(touch_driver_t)); } @@ -112,7 +106,13 @@ secbool touch_activity(void) { return state > 0 ? sectrue : secfalse;*/ } -static uint32_t touch_get_state(touch_driver_t* drv) { +uint32_t touch_get_state(void) { + touch_driver_t* drv = &g_touch_driver; + + if (sectrue != drv->initialized) { + return 0; + } + TS_StateTypeDef ts = {0}; BSP_TS_GetState(&ts); @@ -142,58 +142,4 @@ static uint32_t touch_get_state(touch_driver_t* drv) { return state; } -uint32_t touch_get_event(void) { - touch_driver_t* drv = &g_touch_driver; - - if (sectrue != drv->initialized) { - return 0; - } - - touch_fsm_t* fsm = &drv->tls[systask_id(systask_active())]; - - uint32_t touch_state = touch_get_state(drv); - - uint32_t event = touch_fsm_get_event(fsm, touch_state); - - return event; -} - -static void on_task_created(void* context, systask_id_t task_id) { - touch_driver_t* drv = (touch_driver_t*)context; - touch_fsm_t* fsm = &drv->tls[task_id]; - touch_fsm_init(fsm); -} - -static void on_event_poll(void* context, bool read_awaited, - bool write_awaited) { - touch_driver_t* drv = (touch_driver_t*)context; - - UNUSED(write_awaited); - - if (read_awaited) { - uint32_t touch_state = touch_get_state(drv); - if (touch_state != 0) { - syshandle_signal_read_ready(SYSHANDLE_TOUCH, &touch_state); - } - } -} - -static bool on_check_read_ready(void* context, systask_id_t task_id, - void* param) { - touch_driver_t* drv = (touch_driver_t*)context; - touch_fsm_t* fsm = &drv->tls[task_id]; - - uint32_t touch_state = *(uint32_t*)param; - - return touch_fsm_event_ready(fsm, touch_state); -} - -static const syshandle_vmt_t g_touch_handle_vmt = { - .task_created = on_task_created, - .task_killed = NULL, - .check_read_ready = on_check_read_ready, - .check_write_ready = NULL, - .poll = on_event_poll, -}; - #endif // KERNEL_MODE diff --git a/core/embed/io/touch/touch_fsm.h b/core/embed/io/touch/touch_fsm.h deleted file mode 100644 index 642b37a98b..0000000000 --- a/core/embed/io/touch/touch_fsm.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of the Trezor project, https://trezor.io/ - * - * Copyright (c) SatoshiLabs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -// This module is a simple finite state machine for touch events. -// -// It is designed to be used in a polling loop, where the state of the touch -// is read periodically. The module keeps track of the state changes and -// provides a simple interface to get the events that happened since the last -// call to touch_fsm_get_event(). -// -// The benefit of using this module is that it can properly handle situations -// when the touch panel is not read frequently enough or when some -// touch events are missed. -// -// The structure is designed to be used in a multi-threaded environment, where -// each thread has its own state machine. The state machines are stored in an -// array indexed by the task ID. - -typedef struct { - // Time (in ticks) when the tls was last updated - uint32_t update_ticks; - // Last reported touch state - uint32_t state; - // Set if the touch controller is currently touched - // (respectively, that we detected a touch event) - bool pressed; - // Previously reported x-coordinate - uint16_t last_x; - // Previously reported y-coordinate - uint16_t last_y; -} touch_fsm_t; - -// Initializes button finite state machine -void touch_fsm_init(touch_fsm_t* fsm); - -// Checks if touch_fsm_get_event() would return `true` on the next call -bool touch_fsm_event_ready(touch_fsm_t* fsm, uint32_t touch_state); - -// Processes the new state of thetouch panel and fills the event structure. -// -// `touch_state` is the current state of the touch panel. The state has -// the same format as the return value of `touch_get_state()`. -// -// Returns `true` if the event structure was filled. -uint32_t touch_fsm_get_event(touch_fsm_t* fsm, uint32_t touch_state); diff --git a/core/embed/io/touch/touch_fsm.c b/core/embed/io/touch/touch_poll.c similarity index 58% rename from core/embed/io/touch/touch_fsm.c rename to core/embed/io/touch/touch_poll.c index 6d262e6611..cfd89f97ab 100644 --- a/core/embed/io/touch/touch_fsm.c +++ b/core/embed/io/touch/touch_poll.c @@ -22,11 +22,41 @@ #include #include +#include +#include #include -#include "touch_fsm.h" +#include "touch_poll.h" -void touch_fsm_init(touch_fsm_t* fsm) { +// #define TOUCH_TRACE_EVENT + +typedef struct { + // Time (in ticks) when the tls was last updated + uint32_t update_ticks; + // Last reported touch state + uint32_t state; + // Set if the touch controller is currently touched + // (respectively, that we detected a touch event) + bool pressed; + // Previously reported x-coordinate + uint16_t last_x; + // Previously reported y-coordinate + uint16_t last_y; +} touch_fsm_t; + +// Touch state machine for each task +static touch_fsm_t g_touch_tls[SYSTASK_MAX_TASKS]; + +// Forward declarations +static const syshandle_vmt_t g_touch_handle_vmt; + +bool touch_poll_init(void) { + return syshandle_register(SYSHANDLE_TOUCH, &g_touch_handle_vmt, NULL); +} + +void touch_poll_deinit(void) { syshandle_unregister(SYSHANDLE_TOUCH); } + +static void touch_fsm_clear(touch_fsm_t* fsm) { memset(fsm, 0, sizeof(touch_fsm_t)); fsm->update_ticks = systick_ms(); } @@ -35,6 +65,25 @@ bool touch_fsm_event_ready(touch_fsm_t* fsm, uint32_t touch_state) { return fsm->state != touch_state; } +#ifdef TOUCH_TRACE_EVENT +void trace_event(uint32_t event) { + char event_type = (event & TOUCH_START) ? 'D' + : (event & TOUCH_MOVE) ? 'M' + : (event & TOUCH_END) ? 'U' + : '-'; + + uint16_t x = touch_unpack_x(event); + uint16_t y = touch_unpack_y(event); + + uint32_t time = hal_ticks_ms() % 10000; + + systask_id_t task_id = systask_id(systask_active()); + + printf("%04ld [task=%d, event=%c, x=%3d, y=%3d]\r\n", time, task_id, + event_type, x, y); +} +#endif + uint32_t touch_fsm_get_event(touch_fsm_t* fsm, uint32_t touch_state) { uint32_t ticks = hal_ticks_ms(); @@ -111,4 +160,52 @@ uint32_t touch_fsm_get_event(touch_fsm_t* fsm, uint32_t touch_state) { return event; } +uint32_t touch_get_event(void) { + touch_fsm_t* fsm = &g_touch_tls[systask_id(systask_active())]; + + uint32_t touch_state = touch_get_state(); + + uint32_t event = touch_fsm_get_event(fsm, touch_state); + +#ifdef TOUCH_TRACE_EVENT + if (event != 0) { + trace_event(event); + } +#endif + + return event; +} + +static void on_task_created(void* context, systask_id_t task_id) { + touch_fsm_t* fsm = &g_touch_tls[task_id]; + touch_fsm_clear(fsm); +} + +static void on_event_poll(void* context, bool read_awaited, + bool write_awaited) { + UNUSED(write_awaited); + + if (read_awaited) { + uint32_t touch_state = touch_get_state(); + syshandle_signal_read_ready(SYSHANDLE_TOUCH, &touch_state); + } +} + +static bool on_check_read_ready(void* context, systask_id_t task_id, + void* param) { + touch_fsm_t* fsm = &g_touch_tls[task_id]; + + uint32_t touch_state = *(uint32_t*)param; + + return touch_fsm_event_ready(fsm, touch_state); +} + +static const syshandle_vmt_t g_touch_handle_vmt = { + .task_created = on_task_created, + .task_killed = NULL, + .check_read_ready = on_check_read_ready, + .check_write_ready = NULL, + .poll = on_event_poll, +}; + #endif // KERNEL_MODE diff --git a/core/embed/io/touch/touch_poll.h b/core/embed/io/touch/touch_poll.h new file mode 100644 index 0000000000..74fb59cf3d --- /dev/null +++ b/core/embed/io/touch/touch_poll.h @@ -0,0 +1,24 @@ +/* + * This file is part of the Trezor project, https://trezor.io/ + * + * Copyright (c) SatoshiLabs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +bool touch_poll_init(void); + +void touch_poll_deinit(void); diff --git a/core/embed/io/touch/unix/touch.c b/core/embed/io/touch/unix/touch.c index fa127ea1cb..24aad4e67b 100644 --- a/core/embed/io/touch/unix/touch.c +++ b/core/embed/io/touch/unix/touch.c @@ -21,11 +21,10 @@ #include #include -#include #include #include -#include "../touch_fsm.h" +#include "../touch_poll.h" extern int sdl_display_res_x, sdl_display_res_y; extern int sdl_touch_offset_x, sdl_touch_offset_y; @@ -62,8 +61,6 @@ typedef struct { // Last event not yet read uint32_t last_event; - // Touch state machine for each task - touch_fsm_t tls[SYSTASK_MAX_TASKS]; } touch_driver_t; @@ -72,9 +69,6 @@ static touch_driver_t g_touch_driver = { .initialized = secfalse, }; -// Forward declarations -static const syshandle_vmt_t g_touch_handle_vmt; - static bool is_inside_display(int x, int y) { return x >= sdl_touch_offset_x && y >= sdl_touch_offset_y && x - sdl_touch_offset_x < sdl_display_res_x && @@ -209,7 +203,7 @@ secbool touch_init(void) { memset(drv, 0, sizeof(touch_driver_t)); drv->state = IDLE; - if (!syshandle_register(SYSHANDLE_TOUCH, &g_touch_handle_vmt, drv)) { + if (!touch_poll_init()) { goto cleanup; } @@ -228,7 +222,7 @@ void touch_deinit(void) { touch_driver_t* drv = &g_touch_driver; if (drv->initialized == sectrue) { - syshandle_unregister(SYSHANDLE_TOUCH); + touch_poll_deinit(); memset(drv, 0, sizeof(touch_driver_t)); } } @@ -260,7 +254,13 @@ secbool touch_activity(void) { } } -uint32_t touch_get_state(touch_driver_t* drv) { +uint32_t touch_get_state(void) { + touch_driver_t* drv = &g_touch_driver; + + if (sectrue != drv->initialized) { + return 0; + } + sdl_events_poll(); if (drv->state == BUTTON_SWIPE_INITIATED) { @@ -277,57 +277,3 @@ uint32_t touch_get_state(touch_driver_t* drv) { return drv->last_event; } - -uint32_t touch_get_event(void) { - touch_driver_t* driver = &g_touch_driver; - - if (sectrue != driver->initialized) { - return 0; - } - - touch_fsm_t* fsm = &driver->tls[systask_id(systask_active())]; - - uint32_t touch_state = touch_get_state(driver); - - uint32_t event = touch_fsm_get_event(fsm, touch_state); - - return event; -} - -static void on_task_created(void* context, systask_id_t task_id) { - touch_driver_t* dr = (touch_driver_t*)context; - touch_fsm_t* fsm = &dr->tls[task_id]; - touch_fsm_init(fsm); -} - -static void on_event_poll(void* context, bool read_awaited, - bool write_awaited) { - touch_driver_t* drv = (touch_driver_t*)context; - - UNUSED(write_awaited); - - if (read_awaited) { - uint32_t touch_state = touch_get_state(drv); - if (touch_state != 0) { - syshandle_signal_read_ready(SYSHANDLE_TOUCH, &touch_state); - } - } -} - -static bool on_check_read_ready(void* context, systask_id_t task_id, - void* param) { - touch_driver_t* drv = (touch_driver_t*)context; - touch_fsm_t* fsm = &drv->tls[task_id]; - - uint32_t touch_state = *(uint32_t*)param; - - return touch_fsm_event_ready(fsm, touch_state); -} - -static const syshandle_vmt_t g_touch_handle_vmt = { - .task_created = on_task_created, - .task_killed = NULL, - .check_read_ready = on_check_read_ready, - .check_write_ready = NULL, - .poll = on_event_poll, -}; diff --git a/core/site_scons/models/D001/discovery.py b/core/site_scons/models/D001/discovery.py index 4991e0e8ed..01558dc22a 100644 --- a/core/site_scons/models/D001/discovery.py +++ b/core/site_scons/models/D001/discovery.py @@ -73,7 +73,7 @@ def configure( sources += ["embed/io/i2c_bus/stm32f4/i2c_bus.c"] sources += ["embed/io/touch/stmpe811/stmpe811.c"] sources += ["embed/io/touch/stmpe811/touch.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] paths += ["embed/io/i2c_bus/inc"] paths += ["embed/io/touch/inc"] features_available.append("touch") diff --git a/core/site_scons/models/D002/discovery2.py b/core/site_scons/models/D002/discovery2.py index c1abee7354..b03efdf319 100644 --- a/core/site_scons/models/D002/discovery2.py +++ b/core/site_scons/models/D002/discovery2.py @@ -57,7 +57,7 @@ def configure( sources += ["embed/io/i2c_bus/stm32u5/i2c_bus.c"] sources += ["embed/io/touch/sitronix/touch.c"] sources += ["embed/io/touch/sitronix/sitronix.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] paths += ["embed/io/i2c_bus/inc"] paths += ["embed/io/touch/inc"] features_available.append("touch") diff --git a/core/site_scons/models/T2T1/emulator.py b/core/site_scons/models/T2T1/emulator.py index 0f88116cf8..0ecf67c841 100644 --- a/core/site_scons/models/T2T1/emulator.py +++ b/core/site_scons/models/T2T1/emulator.py @@ -52,7 +52,7 @@ def configure( if "input" in features_wanted: sources += ["embed/io/touch/unix/touch.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] paths += ["embed/io/touch/inc"] features_available.append("touch") defines += [("USE_TOUCH", "1")] diff --git a/core/site_scons/models/T2T1/trezor_t.py b/core/site_scons/models/T2T1/trezor_t.py index adc0b6767b..f0a1a417f9 100644 --- a/core/site_scons/models/T2T1/trezor_t.py +++ b/core/site_scons/models/T2T1/trezor_t.py @@ -63,7 +63,7 @@ def configure( if "input" in features_wanted: sources += ["embed/io/i2c_bus/stm32f4/i2c_bus.c"] sources += ["embed/io/touch/ft6x36/ft6x36.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] paths += ["embed/io/i2c_bus/inc"] paths += ["embed/io/touch/inc"] features_available.append("touch") diff --git a/core/site_scons/models/T3T1/emulator.py b/core/site_scons/models/T3T1/emulator.py index cae604fa76..89dd8ef7e8 100644 --- a/core/site_scons/models/T3T1/emulator.py +++ b/core/site_scons/models/T3T1/emulator.py @@ -62,7 +62,7 @@ def configure( if "input" in features_wanted: sources += ["embed/io/touch/unix/touch.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] paths += ["embed/io/touch/inc"] features_available.append("touch") defines += [("USE_TOUCH", "1")] diff --git a/core/site_scons/models/T3T1/trezor_t3t1_revE.py b/core/site_scons/models/T3T1/trezor_t3t1_revE.py index c679672932..44d8c187ad 100644 --- a/core/site_scons/models/T3T1/trezor_t3t1_revE.py +++ b/core/site_scons/models/T3T1/trezor_t3t1_revE.py @@ -66,7 +66,7 @@ def configure( if "input" in features_wanted: sources += ["embed/io/i2c_bus/stm32u5/i2c_bus.c"] sources += ["embed/io/touch/ft6x36/ft6x36.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] sources += ["embed/io/touch/ft6x36/panels/lx154a2422cpt23.c"] paths += ["embed/io/i2c_bus/inc"] paths += ["embed/io/touch/inc"] diff --git a/core/site_scons/models/T3W1/emulator.py b/core/site_scons/models/T3W1/emulator.py index 3873c1e5e5..3068256e88 100644 --- a/core/site_scons/models/T3W1/emulator.py +++ b/core/site_scons/models/T3W1/emulator.py @@ -82,7 +82,7 @@ def configure( if "input" in features_wanted: sources += ["embed/io/touch/unix/touch.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] paths += ["embed/io/touch/inc"] features_available.append("touch") defines += [("USE_TOUCH", "1")] diff --git a/core/site_scons/models/T3W1/trezor_t3w1_revA.py b/core/site_scons/models/T3W1/trezor_t3w1_revA.py index ec8f11cf16..4d5b965735 100644 --- a/core/site_scons/models/T3W1/trezor_t3w1_revA.py +++ b/core/site_scons/models/T3W1/trezor_t3w1_revA.py @@ -61,7 +61,7 @@ def configure( if "input" in features_wanted: sources += ["embed/io/touch/ft6x36/ft6x36.c"] sources += ["embed/io/touch/ft6x36/panels/lx250a2410a.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] paths += ["embed/io/touch/inc"] features_available.append("touch") sources += ["embed/io/button/stm32/button.c"] diff --git a/core/site_scons/models/T3W1/trezor_t3w1_revB.py b/core/site_scons/models/T3W1/trezor_t3w1_revB.py index dce3f0814e..16c1d63ac1 100644 --- a/core/site_scons/models/T3W1/trezor_t3w1_revB.py +++ b/core/site_scons/models/T3W1/trezor_t3w1_revB.py @@ -61,7 +61,7 @@ def configure( if "input" in features_wanted: sources += ["embed/io/touch/ft6x36/ft6x36.c"] sources += ["embed/io/touch/ft6x36/panels/lx250a2410a.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] paths += ["embed/io/touch/inc"] features_available.append("touch") sources += ["embed/io/button/stm32/button.c"] diff --git a/core/site_scons/models/T3W1/trezor_t3w1_revC.py b/core/site_scons/models/T3W1/trezor_t3w1_revC.py index 558e5b4170..a65393a193 100644 --- a/core/site_scons/models/T3W1/trezor_t3w1_revC.py +++ b/core/site_scons/models/T3W1/trezor_t3w1_revC.py @@ -61,7 +61,7 @@ def configure( if "input" in features_wanted: sources += ["embed/io/touch/ft6x36/ft6x36.c"] sources += ["embed/io/touch/ft6x36/panels/lx250a2410a.c"] - sources += ["embed/io/touch/touch_fsm.c"] + sources += ["embed/io/touch/touch_poll.c"] paths += ["embed/io/touch/inc"] features_available.append("touch") sources += ["embed/io/button/stm32/button.c"]