Skip to main content

boot_factory_reset

Function boot_factory_reset 

Source
pub async fn boot_factory_reset(button: &Input<'_>)
Expand description

Power-up factory-reset hold (README: hold while applying power).

Returns immediately after a software-triggered boot (WS reset, ButtonAction::Reboot, panic recovery) or when the button is not held. Otherwise the LED shows LedStatus::Resetting until RESET_HOLD elapses, the config is cleared, the LED turns solid (LedStatus::Ok) and the function waits for the release before rebooting. Releasing before the deadline aborts with LedStatus::Warning and boot continues.

Call after storage::init and the LED task are running. On a successful reset it never returns; if NVS cannot be cleared the reset is aborted (no reboot into a factory reset that did not happen).