Merge branch 'master' of https://github.com/jpirnay/crosspoint-reader into feat-expose-override
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <SPI.h>
|
||||
#include <WiFi.h>
|
||||
#include <builtinFonts/all.h>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <esp_ota_ops.h>
|
||||
|
||||
#include <cstring>
|
||||
@@ -28,6 +29,7 @@
|
||||
#include "KOReaderCredentialStore.h"
|
||||
#include "MappedInputManager.h"
|
||||
#include "OpdsServerStore.h"
|
||||
#include "ReadingSessionTracker.h"
|
||||
#include "ReadingStats.h"
|
||||
#include "RecentBooksStore.h"
|
||||
#include "SdCardFontSystem.h"
|
||||
@@ -154,6 +156,9 @@ static bool deepSleepInProgress = false;
|
||||
|
||||
void silentRestart() {
|
||||
if (deepSleepInProgress) return; // sleeping supersedes the heap-defrag reboot
|
||||
// ESP.restart() bypasses activity onExit(), so flush any in-flight reading
|
||||
// session manually — otherwise a heap-defrag reboot mid-read loses the session.
|
||||
globalReadingSessionTracker().end();
|
||||
silentRebootTarget = SILENT_REBOOT_TARGET_HOME;
|
||||
silentRebootMagic = SILENT_REBOOT_MAGIC;
|
||||
LOG_DBG("MAIN", "Silent restart (target=home)");
|
||||
@@ -163,6 +168,7 @@ void silentRestart() {
|
||||
|
||||
void silentRestartToReader() {
|
||||
if (deepSleepInProgress) return; // sleeping supersedes the heap-defrag reboot
|
||||
globalReadingSessionTracker().end();
|
||||
silentRebootTarget = SILENT_REBOOT_TARGET_READER;
|
||||
silentRebootMagic = SILENT_REBOOT_MAGIC;
|
||||
LOG_DBG("MAIN", "Silent restart (target=reader)");
|
||||
|
||||
Reference in New Issue
Block a user