1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-19 05:58:09 +00:00

fix(core): fix clearing st7789's internal framebuffer when changing display orientation

[no changelog]
This commit is contained in:
tychovrahe 2024-05-28 13:04:03 +02:00 committed by TychoVrahe
parent 162649aec7
commit fe829a5d59

View File

@ -32,7 +32,10 @@
#include "bg_copy.h"
#endif
#if (DISPLAY_RESX != 240) || (DISPLAY_RESY != 240)
#define INTERNAL_FB_WIDTH 240
#define INTERNAL_FB_HEIGHT 320
#if (DISPLAY_RESX > INTERNAL_FB_WIDTH) || (DISPLAY_RESY > INTERNAL_FB_HEIGHT)
#error "Incompatible display resolution"
#endif
@ -112,8 +115,9 @@ int display_set_orientation(int angle) {
display_physical_fb_clear();
#endif
display_panel_set_window(0, 0, DISPLAY_RESX - 1, DISPLAY_RESY - 1);
for (uint32_t i = 0; i < DISPLAY_RESX * DISPLAY_RESY; i++) {
display_panel_set_window(0, 0, INTERNAL_FB_WIDTH - 1,
INTERNAL_FB_HEIGHT - 1);
for (uint32_t i = 0; i < INTERNAL_FB_WIDTH * INTERNAL_FB_HEIGHT; i++) {
// 2 bytes per pixel because we're using RGB 5-6-5 format
ISSUE_PIXEL_DATA(0x0000);
}