mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-20 16:56:17 +00:00
Compare commits
2 Commits
43d61a550c
...
0af7f838ab
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0af7f838ab | ||
![]() |
1368956a57 |
@ -95,8 +95,10 @@ void InkHUD::LogoApplet::onShutdown()
|
|||||||
|
|
||||||
inverted = true;
|
inverted = true;
|
||||||
inkhud->forceUpdate(Drivers::EInk::FULL, false);
|
inkhud->forceUpdate(Drivers::EInk::FULL, false);
|
||||||
|
delay(1000); // Cooldown. Back to back updates aren't great for health.
|
||||||
inverted = false;
|
inverted = false;
|
||||||
inkhud->forceUpdate(Drivers::EInk::FULL, false);
|
inkhud->forceUpdate(Drivers::EInk::FULL, false);
|
||||||
|
delay(1000); // Cooldown
|
||||||
|
|
||||||
// Prepare for the powered-off screen now
|
// Prepare for the powered-off screen now
|
||||||
// We can change these values because the initial "shutting down" screen has already rendered at this point
|
// We can change these values because the initial "shutting down" screen has already rendered at this point
|
||||||
@ -108,6 +110,19 @@ void InkHUD::LogoApplet::onShutdown()
|
|||||||
// This is then drawn by InkHUD::Events::onShutdown, with a blocking FULL update, after InkHUD's flash write is complete
|
// This is then drawn by InkHUD::Events::onShutdown, with a blocking FULL update, after InkHUD's flash write is complete
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InkHUD::LogoApplet::onReboot()
|
||||||
|
{
|
||||||
|
bringToForeground();
|
||||||
|
|
||||||
|
textLeft = "";
|
||||||
|
textRight = "";
|
||||||
|
textTitle = "Rebooting...";
|
||||||
|
fontTitle = fontSmall;
|
||||||
|
|
||||||
|
inkhud->forceUpdate(Drivers::EInk::FULL, false);
|
||||||
|
// Perform the update right now, waiting here until complete
|
||||||
|
}
|
||||||
|
|
||||||
int32_t InkHUD::LogoApplet::runOnce()
|
int32_t InkHUD::LogoApplet::runOnce()
|
||||||
{
|
{
|
||||||
sendToBackground();
|
sendToBackground();
|
||||||
|
@ -25,6 +25,7 @@ class LogoApplet : public SystemApplet, public concurrency::OSThread
|
|||||||
void onForeground() override;
|
void onForeground() override;
|
||||||
void onBackground() override;
|
void onBackground() override;
|
||||||
void onShutdown() override;
|
void onShutdown() override;
|
||||||
|
void onReboot() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int32_t runOnce() override;
|
int32_t runOnce() override;
|
||||||
|
@ -95,6 +95,7 @@ int InkHUD::Events::beforeDeepSleep(void *unused)
|
|||||||
// We're updating to show that one now.
|
// We're updating to show that one now.
|
||||||
|
|
||||||
inkhud->forceUpdate(Drivers::EInk::UpdateTypes::FULL, false);
|
inkhud->forceUpdate(Drivers::EInk::UpdateTypes::FULL, false);
|
||||||
|
delay(1000); // Cooldown, before potentially yanking display power
|
||||||
|
|
||||||
return 0; // We agree: deep sleep now
|
return 0; // We agree: deep sleep now
|
||||||
}
|
}
|
||||||
@ -111,16 +112,16 @@ int InkHUD::Events::beforeReboot(void *unused)
|
|||||||
a->onDeactivate();
|
a->onDeactivate();
|
||||||
a->onShutdown();
|
a->onShutdown();
|
||||||
}
|
}
|
||||||
for (Applet *sa : inkhud->systemApplets) {
|
for (SystemApplet *sa : inkhud->systemApplets) {
|
||||||
// Note: no onDeactivate. System applets are always active.
|
// Note: no onDeactivate. System applets are always active.
|
||||||
sa->onShutdown();
|
sa->onReboot();
|
||||||
}
|
}
|
||||||
|
|
||||||
inkhud->persistence->saveSettings();
|
inkhud->persistence->saveSettings();
|
||||||
inkhud->persistence->saveLatestMessage();
|
inkhud->persistence->saveLatestMessage();
|
||||||
|
|
||||||
// Note: no forceUpdate call here
|
// Note: no forceUpdate call here
|
||||||
// Because OSThread will not be given another chance to run before reboot, this means that no display update will occur
|
// We don't have any final screen to draw, although LogoApplet::onReboot did already display a "rebooting" screen
|
||||||
|
|
||||||
return 0; // No special status to report. Ignored anyway by this Observable
|
return 0; // No special status to report. Ignored anyway by this Observable
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,8 @@ class SystemApplet : public Applet
|
|||||||
bool lockRendering = false; // - prevent other applets from being rendered during an update
|
bool lockRendering = false; // - prevent other applets from being rendered during an update
|
||||||
bool lockRequests = false; // - prevent other applets from triggering display updates
|
bool lockRequests = false; // - prevent other applets from triggering display updates
|
||||||
|
|
||||||
|
virtual void onReboot() { onShutdown(); } // - handle reboot specially
|
||||||
|
|
||||||
// Other system applets may take precedence over our own system applet though
|
// Other system applets may take precedence over our own system applet though
|
||||||
// The order an applet is passed to WindowManager::addSystemApplet determines this hierarchy (added earlier = higher rank)
|
// The order an applet is passed to WindowManager::addSystemApplet determines this hierarchy (added earlier = higher rank)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user