mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 12:00:59 +00:00
fix(core/bootloader): fix ignoring disconnected touch in production mode
[no changelog]
This commit is contained in:
parent
12c3dc5ff8
commit
c67d185da5
@ -377,17 +377,20 @@ int bootloader_main(void) {
|
|||||||
unit_variant_init();
|
unit_variant_init();
|
||||||
|
|
||||||
#ifdef USE_TOUCH
|
#ifdef USE_TOUCH
|
||||||
|
secbool touch_initialized = secfalse;
|
||||||
|
secbool allow_touchless_mode = secfalse;
|
||||||
#ifdef TREZOR_MODEL_T3T1
|
#ifdef TREZOR_MODEL_T3T1
|
||||||
// on T3T1, tester needs to run without touch, so making an exception
|
// on T3T1, tester needs to run without touch, so making an exception
|
||||||
// until unit variant is written in OTP
|
// until unit variant is written in OTP
|
||||||
if (unit_variant_present()) {
|
const secbool manufacturing_mode =
|
||||||
ensure(touch_init(), "Touch screen panel was not loaded properly.");
|
unit_variant_present() ? secfalse : sectrue;
|
||||||
} else {
|
allow_touchless_mode = manufacturing_mode;
|
||||||
touch_init();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
ensure(touch_init(), "Touch screen panel was not loaded properly.");
|
|
||||||
#endif
|
#endif
|
||||||
|
touch_initialized = touch_init();
|
||||||
|
if (allow_touchless_mode != sectrue) {
|
||||||
|
ensure(touch_initialized, "Touch screen panel was not loaded properly.");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ui_screen_boot_stage_1(false);
|
ui_screen_boot_stage_1(false);
|
||||||
@ -506,8 +509,10 @@ int bootloader_main(void) {
|
|||||||
if (firmware_present == sectrue && stay_in_bootloader != sectrue) {
|
if (firmware_present == sectrue && stay_in_bootloader != sectrue) {
|
||||||
// Wait until the touch controller is ready
|
// Wait until the touch controller is ready
|
||||||
// (on hardware this may take a while)
|
// (on hardware this may take a while)
|
||||||
while (touch_ready() != sectrue) {
|
if (touch_initialized != secfalse) {
|
||||||
hal_delay(1);
|
while (touch_ready() != sectrue) {
|
||||||
|
hal_delay(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef TREZOR_EMULATOR
|
#ifdef TREZOR_EMULATOR
|
||||||
hal_delay(500);
|
hal_delay(500);
|
||||||
|
Loading…
Reference in New Issue
Block a user