From 90bdab6599bb66f54690b18c564cf120bdb6aaef Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Thu, 17 Aug 2023 13:42:22 +0200 Subject: [PATCH] fix(core): fixed unwanted delays in T2B1 [no changelog] --- core/embed/bootloader/main.c | 8 ++++++-- core/embed/prodtest/main.c | 2 +- core/embed/rust/src/ui/model_tr/bootloader/mod.rs | 7 ++----- core/embed/trezorhal/stm32f4/displays/vg-2864ksweg01.c | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/embed/bootloader/main.c b/core/embed/bootloader/main.c index 0098012918..b90f99a4cc 100644 --- a/core/embed/bootloader/main.c +++ b/core/embed/bootloader/main.c @@ -307,6 +307,8 @@ int bootloader_main(void) { display_reinit(); + ui_screen_boot_empty(false); + mpu_config_bootloader(); const image_header *hdr = NULL; @@ -351,8 +353,6 @@ int bootloader_main(void) { display_set_little_endian(); #endif - ui_screen_boot_empty(false); - #ifdef USE_I2C i2c_init(); #endif @@ -426,7 +426,11 @@ int bootloader_main(void) { ui_set_initial_setup(true); ui_screen_welcome_model(); +#ifndef USE_BACKLIGHT + hal_delay(1500); +#else hal_delay(1000); +#endif ui_screen_welcome(); // erase storage diff --git a/core/embed/prodtest/main.c b/core/embed/prodtest/main.c index 1c63fbe814..399a8d9bcd 100644 --- a/core/embed/prodtest/main.c +++ b/core/embed/prodtest/main.c @@ -519,6 +519,7 @@ static void test_otp_write_device_variant(const char *args) { #define BACKLIGHT_NORMAL 150 int main(void) { + display_reinit(); display_orientation(0); random_delays_init(); #ifdef USE_SD_CARD @@ -536,7 +537,6 @@ int main(void) { #endif usb_init_all(); - display_reinit(); display_clear(); draw_border(1, 3); diff --git a/core/embed/rust/src/ui/model_tr/bootloader/mod.rs b/core/embed/rust/src/ui/model_tr/bootloader/mod.rs index b769ef2e8f..557922068e 100644 --- a/core/embed/rust/src/ui/model_tr/bootloader/mod.rs +++ b/core/embed/rust/src/ui/model_tr/bootloader/mod.rs @@ -1,7 +1,7 @@ use crate::{ strutil::hexlify, time::Duration, - trezorhal::{io::io_button_read, time}, + trezorhal::io::io_button_read, ui::{ component::{Component, Event, EventCtx, Label, LineBreaking::BreakWordsNoHyphen, Never}, constant::SCREEN, @@ -320,7 +320,7 @@ extern "C" fn screen_wipe_fail() { } #[no_mangle] -extern "C" fn screen_boot_empty(_firmware_present: bool) { +extern "C" fn screen_boot_empty(_fading: bool) { display::rect_fill(SCREEN, BLD_BG); LOGO_EMPTY.draw( SCREEN.top_center() + Offset::y(11), @@ -329,9 +329,6 @@ extern "C" fn screen_boot_empty(_firmware_present: bool) { BLD_BG, ); display::refresh(); - if !_firmware_present { - time::sleep(Duration::from_millis(1000)); - } } #[no_mangle] diff --git a/core/embed/trezorhal/stm32f4/displays/vg-2864ksweg01.c b/core/embed/trezorhal/stm32f4/displays/vg-2864ksweg01.c index 9443de746b..4b56d6199b 100644 --- a/core/embed/trezorhal/stm32f4/displays/vg-2864ksweg01.c +++ b/core/embed/trezorhal/stm32f4/displays/vg-2864ksweg01.c @@ -228,9 +228,9 @@ void display_init(void) { // Reset the LCD HAL_GPIO_WritePin(OLED_RST_PORT, OLED_RST_PIN, GPIO_PIN_SET); - HAL_Delay(40); + HAL_Delay(1); HAL_GPIO_WritePin(OLED_RST_PORT, OLED_RST_PIN, GPIO_PIN_RESET); - HAL_Delay(400); + HAL_Delay(1); HAL_GPIO_WritePin(OLED_RST_PORT, OLED_RST_PIN, GPIO_PIN_SET); // init