fix(core): initialize haptic driver in the emulator
What changed, and why it matters
This commit fixes a missing initialization step in the Trezor hardware wallet emulator (the software version used for testing/development, not the real device). The emulator now initializes the haptic driver when haptic feedback is enabled. This is a straightforward bug fix for a feature that was not being set up correctly in the emulator build. There is no direct security relevance visible in the commit.
Treat as a normal functional bug fix. No security response required. If haptic feedback is used in automated emulator tests, verify that initialization now succeeds and does not introduce startup failures.
Security signals we found
No security-relevant keywords in commit title or message
No changelog entry requested by author ([no changelog])
Change is limited to emulator initialization path
No input validation, memory handling, or cryptographic code touched
No references to vulnerabilities, CVEs, or security reports
Evidence from the diff
In core/embed/projects/unix/main_main.c, the patch adds conditional inclusion of io/haptic.h and a call to haptic_init() inside drivers_init() when USE_HAPTIC is defined. The status return value is explicitly marked UNUSED. This only affects the Unix emulator build. The change brings the emulator’s driver initialization in line with real-device builds that already initialize haptic feedback.
Changed components
core/embed/projects/unix/main_main.cTrezor firmware Unix emulator haptic driver initializationInspect captured patch +9 / −0
diff --git a/core/embed/projects/unix/main_main.c b/core/embed/projects/unix/main_main.c
index 06bfe73d..b0a29db6 100644
--- a/core/embed/projects/unix/main_main.c
+++ b/core/embed/projects/unix/main_main.c
@@ -49,6 +49,10 @@
#include <io/ble.h>
#endif
+#ifdef USE_HAPTIC
+#include <io/haptic.h>
+#endif
+
#ifdef USE_POWER_MANAGER
#include <io/power_manager.h>
#endif
@@ -103,6 +107,11 @@ static void drivers_init(void) {
ble_init();
#endif
+#ifdef USE_HAPTIC
+ ts_t status = haptic_init();
+ UNUSED(status);
+#endif
+
#ifdef USE_POWER_MANAGER
pm_init(true);
#endif
Why this scored 18/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.