1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00

fix(core): switch define to invert display colors into const volatile

using define causes compiler to over-optimize the code in display_init_seq
leading to larger differences in the resulting binaries when the flag changes

we want to keep the difference to minimum (1 byte) and using const volatile
instead of define achieves that
This commit is contained in:
Pavol Rusnak 2021-03-11 12:24:47 +01:00
parent e7966cc804
commit d211e3af07
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -19,7 +19,12 @@
#include STM32_HAL_H #include STM32_HAL_H
#define DISPLAY_ST7789V_INVERT_COLORS 0 // 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.
const volatile uint8_t DISPLAY_ST7789V_INVERT_COLORS = 0;
// FSMC/FMC Bank 1 - NOR/PSRAM 1 // FSMC/FMC Bank 1 - NOR/PSRAM 1
#define DISPLAY_MEMORY_BASE 0x60000000 #define DISPLAY_MEMORY_BASE 0x60000000