Prevent render conficts (hopefully)

This commit is contained in:
jpirnay
2026-04-09 23:31:18 +02:00
parent 9971392862
commit 0f2ab3b39d
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -44,4 +44,5 @@ class HomeActivity final : public Activity {
void onExit() override;
void loop() override;
void render(RenderLock&&) override;
bool preventAutoSleep() override { return !firstRenderDone || recentsLoading || !recentsLoaded; }
};
+4
View File
@@ -135,6 +135,10 @@ void enterDeepSleep() {
activityManager.goToSleep();
// Keep the render mutex until the CPU enters deep sleep so any previously queued
// render task cannot race the synchronous sleep-screen transition.
RenderLock renderLock;
display.deepSleep();
LOG_DBG("MAIN", "Entering deep sleep (powerBtn isPressed=%d, rawPin=%d)", gpio.isPressed(HalGPIO::BTN_POWER),
digitalRead(InputManager::POWER_BUTTON_PIN) == LOW);