From 0d02415c82db51523d3051065e91e97fb663eb7c Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 6 Nov 2022 03:05:30 +0800 Subject: [PATCH] remove automounter from the status thread it's now in shellchat. In general, the program that is assigned as the initial app context is responsible for ensuring the PDDB is mounted. Thus, if `vault` were to become a stand-alone app, it should include some code to make sure the PDDB is mounted as part of its boot sequence. The reason is that it allows the initial app to guide the power-on experience, instead of delegating this to the `status` bar, which is oblivious to the state of the app. --- services/status/src/main.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/services/status/src/main.rs b/services/status/src/main.rs index ec77fb239..b9c592242 100644 --- a/services/status/src/main.rs +++ b/services/status/src/main.rs @@ -633,41 +633,6 @@ fn wrapped_main() -> ! { #[cfg(any(feature="precursor", feature="renode"))] llio.clear_wakeup_alarm().unwrap(); // this is here to clear any wake-up alarms that were set by a prior coldboot command - // spawn a thread to auto-mount the PDDB - let _ = thread::spawn({ - move || { - let tt = ticktimer_server::Ticktimer::new().unwrap(); - tt.sleep_ms(2000).unwrap(); // a brief pause, to allow the other startup bits to finish running - loop { - let (no_retry_failure, count) = pddb::Pddb::new().try_mount(); - if no_retry_failure { - // this includes both successfully mounted, and user abort of mount attempt - break; - } else { - // this indicates system was guttered due to a retry failure - let xns = xous_names::XousNames::new().unwrap(); - let susres = susres::Susres::new_without_hook(&xns).unwrap(); - let llio = llio::Llio::new(&xns); - if ((llio.adc_vbus().unwrap() as u32) * 503) < 150_000 { - // try to force suspend if possible, so that users who are just playing around with - // the device don't run the battery down accidentally. - susres.initiate_suspend().ok(); - tt.sleep_ms(1000).unwrap(); - let modals = modals::Modals::new(&xns).unwrap(); - modals.show_notification( - &t!("login.fail", xous::LANG).replace("{fails}", &count.to_string()), - None - ).ok(); - } else { - // otherwise force a reboot cycle to slow down guessers - susres.reboot(true).expect("Couldn't reboot after too many failed password attempts"); - tt.sleep_ms(5000).unwrap(); - } - } - } - } - }); - pump_run.store(true, Ordering::Relaxed); // start status thread updating loop { let msg = xous::receive_message(status_sid).unwrap();