document entry point
This commit is contained in:
parent
34fb92ef21
commit
2fa6935820
@ -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 :(");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user