feat(core): add T3W1 touch wakeup emulation support
What changed, and why it matters
This commit adds emulator-only support for a new Trezor device (T3W1) to wake from a simulated low-power sleep state when the user taps the emulated touchscreen. It only affects the software emulator build, not real hardware, and does not change how secrets or user data are handled. There is no indication this is a security fix.
No security action required. Treat as normal feature commit for emulator support.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change enables USE_SUSPEND and USE_TOUCH_WAKEUP for the T3W1 emulator target, wires SDL mouse-button events into the Unix power_manager suspend loop, and honors the touch_wakeup_get_enabled() state so mouse clicks are ignored when tap-to-wake is disabled. It is a feature/enabling commit for emulator parity with a new hardware model. No cryptographic, storage, or trust-boundary logic is modified.
Changed components
core/embed/io/power_manager/unix/power_manager.ccore/site_scons/models/T3W1/emulator.pycore/SConscript.unixcore/SConscript.bootloader_emucore/SConscript.prodtest_emuInspect captured patch +25 / −5
diff --git a/core/SConscript.bootloader_emu b/core/SConscript.bootloader_emu
index 96672085..689d741d 100644
--- a/core/SConscript.bootloader_emu
+++ b/core/SConscript.bootloader_emu
@@ -32,6 +32,7 @@ FEATURES_WANTED = [
"power_manager",
"rgb_led",
"secure_mode",
+ "suspend",
"usb",
"usb_iface_wire",
]
diff --git a/core/SConscript.prodtest_emu b/core/SConscript.prodtest_emu
index a494efa9..d67ab125 100644
--- a/core/SConscript.prodtest_emu
+++ b/core/SConscript.prodtest_emu
@@ -33,6 +33,7 @@ FEATURES_WANTED = [
"rgb_led",
"sd_card",
"secure_mode",
+ "suspend",
'telemetry',
"tropic",
"usb",
diff --git a/core/SConscript.unix b/core/SConscript.unix
index 34839c0b..2b95ace4 100644
--- a/core/SConscript.unix
+++ b/core/SConscript.unix
@@ -47,6 +47,7 @@ FEATURES_WANTED = [
"secure_mode",
"serial_number",
"storage",
+ "suspend",
"telemetry",
"usb",
"usb_iface_wire",
diff --git a/core/embed/io/power_manager/unix/power_manager.c b/core/embed/io/power_manager/unix/power_manager.c
index d1bbfba6..71d488be 100644
--- a/core/embed/io/power_manager/unix/power_manager.c
+++ b/core/embed/io/power_manager/unix/power_manager.c
@@ -22,6 +22,9 @@
#include <io/display.h>
#include <io/power_manager.h>
#include <io/unix/sdl_display.h>
+#ifdef USE_TOUCH_WAKEUP
+#include <io/touch.h>
+#endif
#include <SDL3/SDL.h>
#include <stdlib.h>
@@ -80,12 +83,21 @@ pm_status_t pm_suspend(wakeup_flags_t* wakeup_reason) {
if (event.type == SDL_EVENT_QUIT) {
exit(1);
}
- if (event.type == SDL_EVENT_KEY_DOWN || event.type == SDL_EVENT_KEY_UP ||
- event.type == SDL_EVENT_MOUSE_BUTTON_DOWN ||
- event.type == SDL_EVENT_MOUSE_BUTTON_UP) {
+ if (event.type == SDL_EVENT_KEY_DOWN || event.type == SDL_EVENT_KEY_UP) {
*wakeup_reason = WAKEUP_FLAG_BUTTON;
break;
}
+#ifdef USE_TOUCH_WAKEUP
+ if (event.type == SDL_EVENT_MOUSE_BUTTON_DOWN ||
+ event.type == SDL_EVENT_MOUSE_BUTTON_UP) {
+ if (!touch_wakeup_get_enabled()) {
+ /* tap-to-wake disabled: ignore touch and stay suspended */
+ continue;
+ }
+ *wakeup_reason = WAKEUP_FLAG_TOUCH;
+ break;
+ }
+#endif
SDL_Delay(50);
}
display_refresh();
diff --git a/core/site_scons/models/T3W1/emulator.py b/core/site_scons/models/T3W1/emulator.py
index 1733fe2f..610ae59e 100644
--- a/core/site_scons/models/T3W1/emulator.py
+++ b/core/site_scons/models/T3W1/emulator.py
@@ -140,6 +140,13 @@ def configure(
sources += ["embed/io/touch/touch_debug.c"]
sources += ["embed/io/button/button_debug.c"]
+ if "suspend" in features_wanted:
+ paths += ["embed/io/suspend/inc"]
+ defines += [("USE_SUSPEND", "1")]
+ if "input" in features_wanted:
+ defines += [("USE_TOUCH_WAKEUP", "1")]
+ features_available.append("touch_wakeup")
+
if "ble" in features_wanted:
sources += ["embed/io/ble/unix/ble.c"]
paths += ["embed/io/ble/inc"]
@@ -159,8 +166,6 @@ def configure(
defines += [("USE_TELEMETRY", "1")]
features_available.append("telemetry")
- paths += ["embed/io/suspend/inc"]
-
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.