/* * lvgl_port — tick, service task, and locking. * * LVGL is not thread-safe. Everything that touches an lv_* object must hold * the lock, including code called from timers and event handlers that runs on * other tasks. The lock is recursive so a UI callback can re-enter without * deadlocking itself. * * Rendering uses the panel's two framebuffers directly in LVGL's FULL refresh * mode: LVGL draws a whole frame into the back buffer, flush hands it to * esp_lcd_panel_draw_bitmap(), and the RGB driver swaps buffers rather than * copying. Nothing ever writes into the buffer being scanned out, which is * what PRD 8.2's warning about persistent framebuffer corruption is about. */ #pragma once #include #include "esp_err.h" #include "lvgl.h" /* Requires display_init(). Creates the display, input devices and task. */ esp_err_t lvgl_port_init(void); /* * Take the LVGL lock. timeout_ms < 0 waits forever. * Every lv_* call from outside a UI callback must be wrapped in this. */ bool lvgl_port_lock(int timeout_ms); void lvgl_port_unlock(void); /* The display LVGL is driving. */ lv_display_t *lvgl_port_display(void);