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:
parent
827a261148
commit
3e66f208f3
@ -48,8 +48,8 @@
|
|||||||
#include <io/display_utils.h>
|
#include <io/display_utils.h>
|
||||||
#include <sys/power_manager.h>
|
#include <sys/power_manager.h>
|
||||||
|
|
||||||
#define FADE_TIME_MS 10000
|
#define FADE_TIME_MS 30000
|
||||||
#define SUSPEND_TIME_MS 15000
|
#define SUSPEND_TIME_MS 40000
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ workflow_result_t workflow_host_control(const vendor_header *const vhdr,
|
|||||||
// device idle.
|
// device idle.
|
||||||
if (!faded && ticks_expired(fade_deadline)) {
|
if (!faded && ticks_expired(fade_deadline)) {
|
||||||
fade_value = display_get_backlight();
|
fade_value = display_get_backlight();
|
||||||
display_fade(fade_value, 20, 200);
|
display_fade(fade_value, 45, 200);
|
||||||
faded = true;
|
faded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ use crate::trezorhal::sysevent::{sysevents_poll, Syshandle};
|
|||||||
|
|
||||||
#[cfg(feature = "power_manager")]
|
#[cfg(feature = "power_manager")]
|
||||||
use crate::{
|
use crate::{
|
||||||
time::Instant,
|
time::{Duration, Instant},
|
||||||
trezorhal::power_manager::{hibernate, is_usb_connected, suspend},
|
trezorhal::power_manager::{hibernate, is_usb_connected, suspend},
|
||||||
ui::display::fade_backlight_duration,
|
ui::display::fade_backlight_duration,
|
||||||
ui::event::PhysicalButton,
|
ui::event::PhysicalButton,
|
||||||
@ -27,6 +27,11 @@ use crate::trezorhal::haptic::{play, HapticEffect};
|
|||||||
use heapless::Vec;
|
use heapless::Vec;
|
||||||
use num_traits::ToPrimitive;
|
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 {
|
pub trait ReturnToC {
|
||||||
fn return_to_c(self) -> u32;
|
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);
|
let elapsed = Instant::now().checked_duration_since(start);
|
||||||
|
|
||||||
if let Some(elapsed) = elapsed {
|
if let Some(elapsed) = elapsed {
|
||||||
if elapsed.to_secs() >= 10 && !faded {
|
if elapsed >= FADE_TIME && !faded {
|
||||||
faded = true;
|
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();
|
suspend();
|
||||||
render(frame);
|
render(frame);
|
||||||
if faded {
|
if faded {
|
||||||
|
Loading…
Reference in New Issue
Block a user