mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-12 09:28:10 +00:00
fixup! fixup! refactor(core): extract framebuffer queue for reuse
This commit is contained in:
parent
28f89601d7
commit
abe2ffe39e
@ -56,11 +56,13 @@ void display_init(display_content_mode_t mode) {
|
|||||||
|
|
||||||
memset(drv, 0, sizeof(display_driver_t));
|
memset(drv, 0, sizeof(display_driver_t));
|
||||||
|
|
||||||
|
#ifdef FRAMEBUFFER
|
||||||
fb_queue_reset(&drv->empty_frames);
|
fb_queue_reset(&drv->empty_frames);
|
||||||
fb_queue_reset(&drv->ready_frames);
|
fb_queue_reset(&drv->ready_frames);
|
||||||
|
|
||||||
fb_queue_put(&drv->empty_frames, 0);
|
fb_queue_put(&drv->empty_frames, 0);
|
||||||
fb_queue_put(&drv->empty_frames, 1);
|
fb_queue_put(&drv->empty_frames, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (mode == DISPLAY_RESET_CONTENT) {
|
if (mode == DISPLAY_RESET_CONTENT) {
|
||||||
display_io_init_gpio();
|
display_io_init_gpio();
|
||||||
|
@ -216,11 +216,10 @@ void display_refresh(void) {
|
|||||||
|
|
||||||
#else // BOARDLOADER
|
#else // BOARDLOADER
|
||||||
wait_for_te_signal();
|
wait_for_te_signal();
|
||||||
fb_queue_set_ready_for_transfer(&drv->queue);
|
int16_t fb_idx = fb_queue_take(&drv->empty_frames);
|
||||||
fb_idx = fb_queue_get_for_transfer(&drv->queue);
|
|
||||||
if (fb_idx >= 0) {
|
if (fb_idx >= 0) {
|
||||||
copy_fb_to_display(fb_idx);
|
copy_fb_to_display(fb_idx);
|
||||||
fb_queue_set_done(&drv->queue);
|
fb_queue_put(&drv->empty_frames, fb_idx);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user