document entry point

This commit is contained in:
ju6ge 2025-02-27 22:13:50 +01:00
parent 34fb92ef21
commit 2fa6935820
Signed by: judge
GPG Key ID: 6512C30DD8E017B5

View File

@ -978,16 +978,18 @@ fn wait_infinity(wait_type: WaitType, reboot_now: Arc<AtomicBool>) -> ! {
fn main() {
let result = safe_main();
match result {
// this should not get triggered, safe_main should not return but go into deep sleep with sensbile
// timeout, this is just a fallback
Ok(_) => {
println!("Main app finished, restarting");
BOARD_ACCESS.lock().unwrap().set_restart_to_conf(false);
BOARD_ACCESS.lock().unwrap().deep_sleep(1);
}
// if safe_main exists with error, rollback to known good ota version
Err(err) => {
println!("Failed main {}", err);
let rollback_successful = rollback_and_reboot();
println!("Failed to rollback :(");
rollback_successful.unwrap();
panic!("Failed to rollback :(");
}
}
}