mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-15 09:50:57 +00:00
fix(core): fix wrong RSOD color on some older Model T devices
This commit is contained in:
parent
b726e1e203
commit
34e033fd4e
1
core/.changelog.d/4491.fixed
Normal file
1
core/.changelog.d/4491.fixed
Normal file
@ -0,0 +1 @@
|
||||
[T2T1] Fix wrong RSOD color on some older Model T devices
|
@ -61,6 +61,12 @@ bool display_init(display_content_mode_t mode) {
|
||||
#endif
|
||||
|
||||
if (mode == DISPLAY_RESET_CONTENT) {
|
||||
#if defined TREZOR_MODEL_T2T1 && !defined BOARDLOADER
|
||||
// This is required for the model T to work correctly.
|
||||
// Boardloader does this by constant in binary, other stages need to read
|
||||
// this from the display
|
||||
display_panel_preserve_inversion();
|
||||
#endif
|
||||
display_io_init_gpio();
|
||||
display_io_init_fmc();
|
||||
display_panel_init();
|
||||
|
@ -47,14 +47,26 @@
|
||||
|
||||
#ifdef KERNEL_MODE
|
||||
|
||||
#ifdef TREZOR_MODEL_T2T1
|
||||
#ifdef BOARDLOADER
|
||||
// using const volatile instead of #define results in binaries that change
|
||||
// only in 1-byte when the flag changes.
|
||||
// using #define leads compiler to over-optimize the code leading to bigger
|
||||
// differencies in the resulting binaries.
|
||||
// differences in the resulting binaries.
|
||||
const volatile uint8_t DISPLAY_ST7789V_INVERT_COLORS2 = 1;
|
||||
|
||||
#else
|
||||
|
||||
volatile uint8_t DISPLAY_ST7789V_INVERT_COLORS2 = 0;
|
||||
|
||||
void display_panel_preserve_inversion(void) {
|
||||
DISPLAY_ST7789V_INVERT_COLORS2 = display_panel_is_inverted();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Window padding (correction) when using 90dg or 270dg orientation
|
||||
// (internally the display is 240x320 but we use only 240x240)
|
||||
// (internally the display is 240x320, but we use only 240x240)
|
||||
static display_padding_t g_window_padding;
|
||||
|
||||
#ifdef DISPLAY_IDENTIFY
|
||||
@ -232,7 +244,7 @@ void display_panel_init(void) {
|
||||
}
|
||||
|
||||
void display_panel_reinit(void) {
|
||||
// reinitialization is needed due to original sequence is unchangable in
|
||||
// reinitialization is needed due to original sequence is unchangeable in
|
||||
// boardloader
|
||||
#ifdef TREZOR_MODEL_T2T1
|
||||
// model TT has new gamma settings
|
||||
|
@ -55,4 +55,8 @@ void display_panel_set_window(uint16_t x0, uint16_t y0, uint16_t x1,
|
||||
uint16_t y1);
|
||||
void display_panel_rotate(int angle);
|
||||
|
||||
#if defined TREZOR_MODEL_T2T1 && !defined BOARDLOADER
|
||||
void display_panel_preserve_inversion(void);
|
||||
#endif
|
||||
|
||||
#endif // TREZORHAL_ST7789_PANEL_H
|
||||
|
Loading…
Reference in New Issue
Block a user