From 3e66f208f327f6836eeefa8b76244c172c0a846c Mon Sep 17 00:00:00 2001 From: obrusvit Date: Tue, 22 Jul 2025 11:54:20 +0200 Subject: [PATCH] feat(core): adjust bootloader suspend and dim time [no changelog] --- .../projects/bootloader/workflow/wf_host_control.c | 6 +++--- core/embed/rust/src/ui/layout/simplified.rs | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/embed/projects/bootloader/workflow/wf_host_control.c b/core/embed/projects/bootloader/workflow/wf_host_control.c index d6f6e97446..3b0bf0a79b 100644 --- a/core/embed/projects/bootloader/workflow/wf_host_control.c +++ b/core/embed/projects/bootloader/workflow/wf_host_control.c @@ -48,8 +48,8 @@ #include #include -#define FADE_TIME_MS 10000 -#define SUSPEND_TIME_MS 15000 +#define FADE_TIME_MS 30000 +#define SUSPEND_TIME_MS 40000 #endif @@ -132,7 +132,7 @@ workflow_result_t workflow_host_control(const vendor_header *const vhdr, // device idle. if (!faded && ticks_expired(fade_deadline)) { fade_value = display_get_backlight(); - display_fade(fade_value, 20, 200); + display_fade(fade_value, 45, 200); faded = true; } diff --git a/core/embed/rust/src/ui/layout/simplified.rs b/core/embed/rust/src/ui/layout/simplified.rs index 79f38b9015..ab29f87ede 100644 --- a/core/embed/rust/src/ui/layout/simplified.rs +++ b/core/embed/rust/src/ui/layout/simplified.rs @@ -15,7 +15,7 @@ use crate::trezorhal::sysevent::{sysevents_poll, Syshandle}; #[cfg(feature = "power_manager")] use crate::{ - time::Instant, + time::{Duration, Instant}, trezorhal::power_manager::{hibernate, is_usb_connected, suspend}, ui::display::fade_backlight_duration, ui::event::PhysicalButton, @@ -27,6 +27,11 @@ use crate::trezorhal::haptic::{play, HapticEffect}; use heapless::Vec; use num_traits::ToPrimitive; +#[cfg(feature = "power_manager")] +const FADE_TIME: Duration = Duration::from_millis(30000); +#[cfg(feature = "power_manager")] +const SUSPEND_TIME: Duration = Duration::from_millis(40000); + pub trait ReturnToC { fn return_to_c(self) -> u32; } @@ -215,11 +220,11 @@ pub fn run(frame: &mut impl Component) -> u32 { let elapsed = Instant::now().checked_duration_since(start); if let Some(elapsed) = elapsed { - if elapsed.to_secs() >= 10 && !faded { + if elapsed >= FADE_TIME && !faded { faded = true; - fade_backlight_duration(20, 200); + fade_backlight_duration(ModelUI::get_backlight_low(), 200); } - if elapsed.to_secs() >= 15 { + if elapsed >= SUSPEND_TIME { suspend(); render(frame); if faded {