|
FastLED 3.10.8
|
| fl::u16 fl::Watchdog::bootloaderEscapeThreshold | ( | ) | const |
Boot-loop escape hatch: drop to the bootloader instead of looping forever, so an unattended host can re-flash the board.
A board whose firmware wedges before its USB stack comes up is invisible to the host – no CDC endpoint, so no 1200-baud touch and no picotool reboot. Nothing on the host can recover it, because a root-hub port reset is a bus reset, not a VBUS power cycle. The only remaining fix is physical. See FastLED#3713 / #3714.
Setting a non-zero threshold makes the device break that loop: after N consecutive watchdog resets, escapeToBootloaderIfLooping() reboots into the bootloader, where the board re-enumerates as a flashable target and the host can push working firmware without a human.
Opt-in by design – the default of 0 disables it. Call the check early in setup(), before any code that might wedge:
Requires FL_WATCHDOG_HAS_BOOTLOADER_REBOOT; elsewhere the escape is a no-op that returns false and leaves the crash counter intact.
Definition at line 104 of file watchdog.cpp.hpp.
References fl::FL_NO_EXCEPT, and mBootloaderEscapeThreshold.
Referenced by setSafeModeThreshold().
Here is the caller graph for this function: