1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-29 09:58:47 +00:00

after mini display

This commit is contained in:
tychovrahe 2022-11-11 21:04:32 +01:00
parent f5e95b9b7b
commit fae09806b9
4 changed files with 19 additions and 0 deletions

View File

@ -108,6 +108,8 @@ void ui_screen_boot(const vendor_header *const vhdr,
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 5 - 25, ver_str, -1, display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 5 - 25, ver_str, -1,
FONT_NORMAL, COLOR_BL_BG, boot_background); FONT_NORMAL, COLOR_BL_BG, boot_background);
} }
display_refresh();
} }
void ui_screen_boot_wait(int wait_seconds) { void ui_screen_boot_wait(int wait_seconds) {
@ -116,6 +118,7 @@ void ui_screen_boot_wait(int wait_seconds) {
display_bar(0, DISPLAY_RESY - 5 - 20, DISPLAY_RESX, 5 + 20, boot_background); display_bar(0, DISPLAY_RESY - 5 - 20, DISPLAY_RESX, 5 + 20, boot_background);
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 5, wait_str, -1, display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 5, wait_str, -1,
FONT_NORMAL, COLOR_BL_BG, boot_background); FONT_NORMAL, COLOR_BL_BG, boot_background);
display_refresh();
} }
void ui_screen_boot_click(void) { void ui_screen_boot_click(void) {
@ -123,6 +126,7 @@ void ui_screen_boot_click(void) {
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 5, display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 5,
"click to continue ...", -1, FONT_NORMAL, COLOR_BL_BG, "click to continue ...", -1, FONT_NORMAL, COLOR_BL_BG,
boot_background); boot_background);
display_refresh();
} }
// welcome UI // welcome UI

View File

@ -19,6 +19,8 @@ pub struct ToifInfo {
pub format: ToifFormat, pub format: ToifFormat,
} }
pub fn refresh() { unsafe {ffi::display_refresh(); }}
pub fn backlight(val: i32) -> i32 { pub fn backlight(val: i32) -> i32 {
unsafe { ffi::display_backlight(val) } unsafe { ffi::display_backlight(val) }
} }

View File

@ -35,6 +35,8 @@ pub use icon::{Icon, IconAndName};
#[cfg(any(feature = "model_tt", feature = "model_tr"))] #[cfg(any(feature = "model_tt", feature = "model_tr"))]
pub use loader::{loader, loader_indeterminate, LOADER_MAX, LOADER_MIN}; pub use loader::{loader, loader_indeterminate, LOADER_MAX, LOADER_MIN};
pub fn refresh() { display::refresh(); }
pub fn backlight() -> u16 { pub fn backlight() -> u16 {
display::backlight(-1) as u16 display::backlight(-1) as u16
} }

View File

@ -78,6 +78,7 @@ where
{ {
frame.place(SCREEN_ADJ); frame.place(SCREEN_ADJ);
frame.paint(); frame.paint();
display::refresh();
fade_backlight_duration(BACKLIGHT_NORMAL as _, 500); fade_backlight_duration(BACKLIGHT_NORMAL as _, 500);
while button_eval().is_some() {} while button_eval().is_some() {}
@ -93,6 +94,7 @@ where
} }
frame.paint(); frame.paint();
display::refresh();
} }
} }
} }
@ -233,6 +235,8 @@ fn screen_progress(
// 0, // 0,
// fill_to as _, // fill_to as _,
// ); // );
display::refresh();
0 0
} }
@ -279,6 +283,7 @@ extern "C" fn screen_connect() -> u32 {
frame.place(SCREEN_ADJ); frame.place(SCREEN_ADJ);
frame.paint(); frame.paint();
display::refresh();
0 0
} }
@ -300,6 +305,7 @@ extern "C" fn screen_wipe_success() -> u32 {
let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_SPINNER, m_top, m_bottom, true); let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_SPINNER, m_top, m_bottom, true);
frame.place(SCREEN_ADJ); frame.place(SCREEN_ADJ);
frame.paint(); frame.paint();
display::refresh();
0 0
} }
@ -321,6 +327,7 @@ extern "C" fn screen_wipe_fail() -> u32 {
let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_ALERT, m_top, m_bottom, true); let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_ALERT, m_top, m_bottom, true);
frame.place(SCREEN_ADJ); frame.place(SCREEN_ADJ);
frame.paint(); frame.paint();
display::refresh();
0 0
} }
@ -346,6 +353,7 @@ extern "C" fn screen_install_fail() -> u32 {
let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_ALERT, m_top, m_bottom, true); let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_ALERT, m_top, m_bottom, true);
frame.place(SCREEN_ADJ); frame.place(SCREEN_ADJ);
frame.paint(); frame.paint();
display::refresh();
0 0
} }
@ -365,6 +373,7 @@ fn screen_install_success_bld(msg: &'static str, complete_draw: bool) -> u32 {
let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_SPINNER, m_top, m_bottom, complete_draw); let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_SPINNER, m_top, m_bottom, complete_draw);
frame.place(SCREEN_ADJ); frame.place(SCREEN_ADJ);
frame.paint(); frame.paint();
display::refresh();
0 0
} }
@ -384,6 +393,7 @@ fn screen_install_success_initial(msg: &'static str, complete_draw: bool) -> u32
let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_SPINNER, m_top, m_bottom, complete_draw); let mut frame = ResultScreen::new(BLD_FG, BLD_BG, ICON_SPINNER, m_top, m_bottom, complete_draw);
frame.place(SCREEN_ADJ); frame.place(SCREEN_ADJ);
frame.paint(); frame.paint();
display::refresh();
0 0
} }
@ -412,5 +422,6 @@ extern "C" fn screen_welcome() -> u32 {
frame.place(SCREEN_ADJ); frame.place(SCREEN_ADJ);
frame.paint(); frame.paint();
display::refresh();
0 0
} }