feat: user path to resume BT from low-memory pause via reader menu toggle

Field session: after a recovery teardown the heap settles at ~72 KB --
below the 100 KB start floor -- and never recovers on its own (the
defrag silent-restart only fires when a build FAILS, and builds succeed
now). BT stayed paused forever, the menu toggle claimed ON, and toggling
off/on changed nothing.

- Menu label tells the truth: ON / PAUSED (enabled but stack down) / OFF
  (new STR_STATE_PAUSED string)
- Toggling BT on below the heap floor silent-restarts into the current
  book: the fresh boot's ~118 KB passes the gate and BT auto-starts on
  resume. Explicit user intent is the right trigger for the defrag.
- Hoist the floor to bleinput::kStartMinFreeHeap, shared by the
  lifecycle gate and the toggle
This commit is contained in:
Nick
2026-07-02 17:25:34 -05:00
parent 551d29744a
commit 793685e76b
4 changed files with 31 additions and 7 deletions
+6
View File
@@ -25,6 +25,12 @@ namespace bleinput {
// Advertised central name shown to peripherals during pairing.
inline constexpr const char* kHostName = "CrossPoint";
// Heap floor for starting the NimBLE stack (~57 KB) while leaving the reader's
// section-build pre-flight (40 KB) satisfiable afterwards. Shared by the main-loop
// lifecycle gate and the reader menu's toggle (which offers a defrag restart when a
// user turns BT on below the floor).
inline constexpr size_t kStartMinFreeHeap = 100 * 1024;
// Start the BLE HID host (idempotent). Returns false if BLE is compiled out or
// NimBLE init failed. Safe to call repeatedly.
bool ensureStarted();