Prevent render conficts (hopefully)
This commit is contained in:
@@ -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; }
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user