mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-13 01:48:21 +00:00
fix(core): TS5 - wait for frame to appear on display before raising backlight
[no changelog]
This commit is contained in:
parent
abe2ffe39e
commit
64e6ff9408
@ -120,6 +120,8 @@ void display_physical_fb_clear(void) {
|
||||
static void bg_copy_callback(void) {
|
||||
display_driver_t *drv = &g_display_driver;
|
||||
|
||||
drv->update_pending = 1;
|
||||
|
||||
fb_queue_put(&drv->empty_frames, fb_queue_take(&drv->ready_frames));
|
||||
}
|
||||
|
||||
@ -129,6 +131,10 @@ static void display_te_interrupt_handler(void) {
|
||||
|
||||
__HAL_GPIO_EXTI_CLEAR_FLAG(DISPLAY_TE_PIN);
|
||||
|
||||
if (drv->update_pending > 0) {
|
||||
drv->update_pending--;
|
||||
}
|
||||
|
||||
int16_t fb_idx = fb_queue_peek(&drv->ready_frames);
|
||||
|
||||
if (fb_idx >= 0) {
|
||||
@ -241,7 +247,7 @@ void display_ensure_refreshed(void) {
|
||||
do {
|
||||
copy_pending = !fb_queue_empty(&drv->ready_frames);
|
||||
__WFI();
|
||||
} while (copy_pending);
|
||||
} while (copy_pending || drv->update_pending);
|
||||
|
||||
// Wait until the display is fully refreshed
|
||||
// (TE signal is low when the display is updating)
|
||||
|
@ -25,6 +25,7 @@ typedef struct {
|
||||
|
||||
// Current display orientation (0, 90, 180, 270)
|
||||
int orientation_angle;
|
||||
int update_pending;
|
||||
|
||||
} display_driver_t;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user