mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2026-04-27 22:35:36 +00:00
Skip all GUI updates and LVGL rendering when display is blanked
gui_update_data() returns early when display_blanked — no LVGL label updates, no bubble physics, no dirty pixels. lv_timer_handler() also skipped — no SPI traffic to a sleeping display. On unblank, lv_obj_invalidate(gui_screen) triggers a full-frame render on the next loop, so the display recovers immediately. Saves CPU, SPI bus time, and display controller power during sleep.
This commit is contained in:
parent
8b3f67c1ee
commit
8bba734d99
1 changed files with 10 additions and 3 deletions
13
Gui.h
13
Gui.h
|
|
@ -695,6 +695,10 @@ static bool gui_is_scrolling() {
|
|||
static void gui_update_data() {
|
||||
if (!gui_time_label) return;
|
||||
|
||||
// Skip all GUI updates when display is blanked — no point rendering
|
||||
// to a sleeping display. Saves CPU, SPI writes, and display power.
|
||||
if (display_blanked) return;
|
||||
|
||||
// Skip data updates during scroll animation — frees CPU for rendering
|
||||
if (gui_is_scrolling()) return;
|
||||
|
||||
|
|
@ -1602,9 +1606,12 @@ void gui_update() {
|
|||
|
||||
gui_update_data();
|
||||
|
||||
gui_render_start = micros();
|
||||
lv_timer_handler();
|
||||
gui_render_us_last = micros() - gui_render_start;
|
||||
// Skip LVGL rendering when display is blanked — no SPI traffic to sleeping display
|
||||
if (!display_blanked) {
|
||||
gui_render_start = micros();
|
||||
lv_timer_handler();
|
||||
gui_render_us_last = micros() - gui_render_start;
|
||||
}
|
||||
// After lv_timer_handler, a new DMA may be queued via gui_flush_cb.
|
||||
// It runs in background on SPI3 until the next gui_update() call.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue