Function esp32_simple::thread::main

source ·
pub fn main<F>(f: F) -> !
where F: FnOnce() -> Result<()>,
Expand description

Runs the main application logic with automatic error logging and device restart on exit.

This function wraps the provided closure to ensure the device restarts if the program exits. Any errors are logged with their full chain before the restart occurs.

§Arguments

  • f - A closure that returns a Result.

§Type Parameters

  • F - The type of the closure.

§Returns

Never returns normally - either runs forever or restarts the device.