Add BLE lifecycle pause mechanism for memory mgmt

Introduces a global pause flag to temporarily block BLE stack auto-start during large memory allocations (e.g., in EPUB rendering). Also adds auto-restart logic for BLE scanning when device list is empty, and extensive debug logging for BLE scan lifecycle troubleshooting.
This commit is contained in:
Justin Mitchell
2026-06-30 16:31:54 -04:00
parent 988652513a
commit c463da994e
10 changed files with 77 additions and 11 deletions
+5
View File
@@ -32,6 +32,11 @@ bool ensureStarted();
// Drop the active link (e.g. before deep sleep or when the user disables BT).
void stop();
// Temporarily block the main-loop BLE lifecycle from auto-starting the stack.
// Used while a render path deliberately frees BLE RAM for a large allocation.
void setLifecyclePaused(bool paused);
bool lifecyclePaused();
// Encode a decoded key event into the stable (kind, value) identity used by the
// settings map. kind: 0 = SpecialKey, 1 = HID usage. Returns false when the event
// carries no usable identity (no special key and no usage code).