1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-04 03:40:58 +00:00

fix(core): add fade-in to boot stage 2 screen if backlight was reset

[no changelog]
This commit is contained in:
tychovrahe 2025-01-29 16:46:46 +01:00 committed by TychoVrahe
parent e2035e1c06
commit 411e8779f7
10 changed files with 17 additions and 15 deletions

View File

@ -44,8 +44,6 @@
// MIPI - // MIPI -
// - STM32U5A9J-DK Discovery Board // - STM32U5A9J-DK Discovery Board
#ifdef KERNEL_MODE
// Specifies how display content should be handled during // Specifies how display content should be handled during
// initialization or deinitialization. // initialization or deinitialization.
typedef enum { typedef enum {
@ -55,6 +53,8 @@ typedef enum {
DISPLAY_RETAIN_CONTENT DISPLAY_RETAIN_CONTENT
} display_content_mode_t; } display_content_mode_t;
#ifdef KERNEL_MODE
// Initializes the display controller. // Initializes the display controller.
// //
// If `mode` is `DISPLAY_RETAIN_CONTENT`, ensure the driver was previously // If `mode` is `DISPLAY_RETAIN_CONTENT`, ensure the driver was previously

View File

@ -17,6 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <trezor_model.h>
#include <trezor_rtl.h> #include <trezor_rtl.h>
#include "py/builtin.h" #include "py/builtin.h"
@ -32,6 +33,7 @@
#include "ports/stm32/gccollect.h" #include "ports/stm32/gccollect.h"
#include "ports/stm32/pendsv.h" #include "ports/stm32/pendsv.h"
#include <io/display.h>
#include <sys/linker_utils.h> #include <sys/linker_utils.h>
#include <sys/systask.h> #include <sys/systask.h>
#include <sys/system.h> #include <sys/system.h>
@ -49,7 +51,7 @@ int main(uint32_t cmd, void *arg) {
system_exit(0); system_exit(0);
} }
screen_boot_stage_2(); screen_boot_stage_2(DISPLAY_JUMP_BEHAVIOR == DISPLAY_RESET_CONTENT);
#ifdef USE_SECP256K1_ZKP #ifdef USE_SECP256K1_ZKP
ensure(sectrue * (zkp_context_init() == 0), NULL); ensure(sectrue * (zkp_context_init() == 0), NULL);

View File

@ -3,7 +3,7 @@
void display_rsod_rust(const char* title, const char* message, void display_rsod_rust(const char* title, const char* message,
const char* footer); const char* footer);
void screen_boot_stage_2(void); void screen_boot_stage_2(bool fade_in);
void display_image(int16_t x, int16_t y, const uint8_t* data, uint32_t datalen); void display_image(int16_t x, int16_t y, const uint8_t* data, uint32_t datalen);
void display_icon(int16_t x, int16_t y, const uint8_t* data, uint32_t datalen, void display_icon(int16_t x, int16_t y, const uint8_t* data, uint32_t datalen,

View File

@ -29,6 +29,6 @@ extern "C" fn display_rsod_rust(
} }
#[no_mangle] #[no_mangle]
extern "C" fn screen_boot_stage_2() { extern "C" fn screen_boot_stage_2(fade_in: bool) {
ModelUI::screen_boot_stage_2(); ModelUI::screen_boot_stage_2(fade_in);
} }

View File

@ -68,8 +68,8 @@ impl CommonUI for UIBolt {
show(&mut frame, false); show(&mut frame, false);
} }
fn screen_boot_stage_2() { fn screen_boot_stage_2(fade_in: bool) {
let mut frame = WelcomeScreen::new(false); let mut frame = WelcomeScreen::new(false);
show(&mut frame, false); show(&mut frame, fade_in);
} }
} }

View File

@ -23,7 +23,7 @@ impl CommonUI for UICaesar {
screens::screen_fatal_error(title, msg, footer); screens::screen_fatal_error(title, msg, footer);
} }
fn screen_boot_stage_2() { fn screen_boot_stage_2(fade_in: bool) {
screens::screen_boot_stage_2(); screens::screen_boot_stage_2(fade_in);
} }
} }

View File

@ -18,7 +18,7 @@ pub fn screen_fatal_error(title: &str, msg: &str, footer: &str) {
display::refresh(); display::refresh();
} }
pub fn screen_boot_stage_2() { pub fn screen_boot_stage_2(_fade_in: bool) {
let mut frame = WelcomeScreen::new(false); let mut frame = WelcomeScreen::new(false);
frame.place(screen()); frame.place(screen());

View File

@ -65,7 +65,7 @@ impl CommonUI for UIDelizia {
screens::screen_fatal_error(title, msg, footer); screens::screen_fatal_error(title, msg, footer);
} }
fn screen_boot_stage_2() { fn screen_boot_stage_2(fade_in: bool) {
screens::screen_boot_stage_2(); screens::screen_boot_stage_2(fade_in);
} }
} }

View File

@ -18,7 +18,7 @@ pub fn screen_fatal_error(title: &str, msg: &str, footer: &str) {
display::refresh(); display::refresh();
} }
pub fn screen_boot_stage_2() { pub fn screen_boot_stage_2(_fade_in: bool) {
let mut frame = WelcomeScreen::new(); let mut frame = WelcomeScreen::new();
frame.place(screen()); frame.place(screen());

View File

@ -25,5 +25,5 @@ pub trait CommonUI {
fn screen_fatal_error(title: &str, msg: &str, footer: &str); fn screen_fatal_error(title: &str, msg: &str, footer: &str);
fn screen_boot_stage_2(); fn screen_boot_stage_2(fade_in: bool);
} }