Pickup stragglers

This commit is contained in:
John Poole 2026-02-16 18:19:16 -08:00
commit 3b15b0aeef
3 changed files with 10 additions and 0 deletions

View file

@ -71,6 +71,11 @@ void StartupSdManager::update() {
bool mounted = mountPreferred(false);
if (!mounted && (uint32_t)(now - lastFullScanMs_) >= cfg_.fullScanIntervalMs) {
lastFullScanMs_ = now;
if (cfg_.recoveryRailCycleOnFullScan) {
logf("Watcher: recovery rail cycle before full scan");
cycleSdRail(cfg_.recoveryRailOffMs, cfg_.recoveryRailOnSettleMs);
delay(150);
}
logf("Watcher: preferred probe failed, running full scan");
mounted = mountCardFullScan();
}

View file

@ -23,6 +23,9 @@ using SdStatusCallback = void (*)(SdEvent event, const char* message);
struct SdWatcherConfig {
bool enableSdRailCycle = true;
bool enablePinDumps = true;
bool recoveryRailCycleOnFullScan = true;
uint32_t recoveryRailOffMs = 250;
uint32_t recoveryRailOnSettleMs = 700;
uint32_t startupWarmupMs = 1500;
uint32_t pollIntervalAbsentMs = 1000;
uint32_t pollIntervalMountedMs = 2000;

View file

@ -45,6 +45,8 @@ Exercise 06: RTC check (PCF8563) read/set and persistence validation
Exercise 07: SD startup watcher library harness with hot-insert detection
Exercise 08: SystemStartup package scaffold (shared begin/update API)
Each exercise is self-contained:
its own platformio.ini