From bd476769cc38d6c91458d8196a6109c405266f59 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Fri, 29 Apr 2022 10:42:40 +0200 Subject: [PATCH] feat(core): add reset state on display clear on model R. Added to rest of the models as noop. --- core/embed/extmod/modtrezorui/display-stm32_1.h | 2 ++ core/embed/extmod/modtrezorui/display-stm32_T.h | 2 ++ core/embed/extmod/modtrezorui/display-unix.h | 2 ++ core/embed/extmod/modtrezorui/display.c | 3 +++ 4 files changed, 9 insertions(+) diff --git a/core/embed/extmod/modtrezorui/display-stm32_1.h b/core/embed/extmod/modtrezorui/display-stm32_1.h index 93b1335f71..34ff1a0545 100644 --- a/core/embed/extmod/modtrezorui/display-stm32_1.h +++ b/core/embed/extmod/modtrezorui/display-stm32_1.h @@ -89,6 +89,8 @@ void PIXELDATA(uint16_t c) { } } +static void display_reset_state() {} + void PIXELDATA_DIRTY() { pixeldata_dirty = true; } static void display_set_window(uint16_t x0, uint16_t y0, uint16_t x1, diff --git a/core/embed/extmod/modtrezorui/display-stm32_T.h b/core/embed/extmod/modtrezorui/display-stm32_T.h index 1b555249f9..815c0dd137 100644 --- a/core/embed/extmod/modtrezorui/display-stm32_T.h +++ b/core/embed/extmod/modtrezorui/display-stm32_T.h @@ -91,6 +91,8 @@ static uint32_t display_identify(void) { return id; } +static void display_reset_state() {} + static void __attribute__((unused)) display_sleep(void) { uint32_t id = display_identify(); if ((id == DISPLAY_ID_ILI9341V) || (id == DISPLAY_ID_GC9307) || diff --git a/core/embed/extmod/modtrezorui/display-unix.h b/core/embed/extmod/modtrezorui/display-unix.h index 81f5cc5768..7a72e2f656 100644 --- a/core/embed/extmod/modtrezorui/display-unix.h +++ b/core/embed/extmod/modtrezorui/display-unix.h @@ -98,6 +98,8 @@ void PIXELDATA(uint16_t c) { } } +static void display_reset_state() {} + void display_init_seq(void) {} void display_deinit(void) { diff --git a/core/embed/extmod/modtrezorui/display.c b/core/embed/extmod/modtrezorui/display.c index 022cca6dc0..20e5d4f0f0 100644 --- a/core/embed/extmod/modtrezorui/display.c +++ b/core/embed/extmod/modtrezorui/display.c @@ -158,6 +158,9 @@ static inline void clamp_coords(int x, int y, int w, int h, int *x0, int *y0, void display_clear(void) { const int saved_orientation = DISPLAY_ORIENTATION; + + display_reset_state(); + // set MADCTL first so that we can set the window correctly next display_orientation(0); // address the complete frame memory