mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-29 04:08:46 +00:00
refactor(core): pass invert_colors to send_init_seq_ST7789V as argument
to make the call more flexible
This commit is contained in:
parent
18e103bb94
commit
69d1465e08
@ -275,7 +275,7 @@ static void send_init_seq_GC9307(void) {
|
|||||||
DATA(0x8F);
|
DATA(0x8F);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_init_seq_ST7789V(void) {
|
static void send_init_seq_ST7789V(uint8_t invert_colors) {
|
||||||
// most recent manual:
|
// most recent manual:
|
||||||
// https://www.newhavendisplay.com/appnotes/datasheets/LCDs/ST7789V.pdf
|
// https://www.newhavendisplay.com/appnotes/datasheets/LCDs/ST7789V.pdf
|
||||||
// TEON: Tearing Effect Line On; V-blanking only
|
// TEON: Tearing Effect Line On; V-blanking only
|
||||||
@ -307,7 +307,7 @@ static void send_init_seq_ST7789V(void) {
|
|||||||
|
|
||||||
// INVOFF (20h): Display Inversion Off
|
// INVOFF (20h): Display Inversion Off
|
||||||
// INVON (21h): Display Inversion On
|
// INVON (21h): Display Inversion On
|
||||||
CMD(0x20 | DISPLAY_ST7789V_INVERT_COLORS);
|
CMD(0x20 | invert_colors);
|
||||||
|
|
||||||
// the above config is the most important and definitely necessary
|
// the above config is the most important and definitely necessary
|
||||||
|
|
||||||
@ -457,7 +457,7 @@ void display_init_seq(void) {
|
|||||||
if (id == DISPLAY_ID_GC9307) {
|
if (id == DISPLAY_ID_GC9307) {
|
||||||
send_init_seq_GC9307();
|
send_init_seq_GC9307();
|
||||||
} else if (id == DISPLAY_ID_ST7789V) {
|
} else if (id == DISPLAY_ID_ST7789V) {
|
||||||
send_init_seq_ST7789V();
|
send_init_seq_ST7789V(DISPLAY_ST7789V_INVERT_COLORS);
|
||||||
} else if (id == DISPLAY_ID_ILI9341V) {
|
} else if (id == DISPLAY_ID_ILI9341V) {
|
||||||
send_init_seq_ILI9341V();
|
send_init_seq_ILI9341V();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user