1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-27 17:08:14 +00:00

feat(core): adjust bootloader suspend and dim time

[no changelog]
This commit is contained in:
obrusvit 2025-07-22 11:54:20 +02:00 committed by Vít Obrusník
parent 827a261148
commit 3e66f208f3
2 changed files with 12 additions and 7 deletions

View File

@ -48,8 +48,8 @@
#include <io/display_utils.h>
#include <sys/power_manager.h>
#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;
}

View File

@ -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<Msg = impl ReturnToC>) -> 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 {