Skip to content

Commit 0d02415

Browse files
committed
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.
1 parent 45009a0 commit 0d02415

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

services/status/src/main.rs

-35
Original file line numberDiff line numberDiff line change
@@ -633,41 +633,6 @@ fn wrapped_main() -> ! {
633633
#[cfg(any(feature="precursor", feature="renode"))]
634634
llio.clear_wakeup_alarm().unwrap(); // this is here to clear any wake-up alarms that were set by a prior coldboot command
635635

636-
// spawn a thread to auto-mount the PDDB
637-
let _ = thread::spawn({
638-
move || {
639-
let tt = ticktimer_server::Ticktimer::new().unwrap();
640-
tt.sleep_ms(2000).unwrap(); // a brief pause, to allow the other startup bits to finish running
641-
loop {
642-
let (no_retry_failure, count) = pddb::Pddb::new().try_mount();
643-
if no_retry_failure {
644-
// this includes both successfully mounted, and user abort of mount attempt
645-
break;
646-
} else {
647-
// this indicates system was guttered due to a retry failure
648-
let xns = xous_names::XousNames::new().unwrap();
649-
let susres = susres::Susres::new_without_hook(&xns).unwrap();
650-
let llio = llio::Llio::new(&xns);
651-
if ((llio.adc_vbus().unwrap() as u32) * 503) < 150_000 {
652-
// try to force suspend if possible, so that users who are just playing around with
653-
// the device don't run the battery down accidentally.
654-
susres.initiate_suspend().ok();
655-
tt.sleep_ms(1000).unwrap();
656-
let modals = modals::Modals::new(&xns).unwrap();
657-
modals.show_notification(
658-
&t!("login.fail", xous::LANG).replace("{fails}", &count.to_string()),
659-
None
660-
).ok();
661-
} else {
662-
// otherwise force a reboot cycle to slow down guessers
663-
susres.reboot(true).expect("Couldn't reboot after too many failed password attempts");
664-
tt.sleep_ms(5000).unwrap();
665-
}
666-
}
667-
}
668-
}
669-
});
670-
671636
pump_run.store(true, Ordering::Relaxed); // start status thread updating
672637
loop {
673638
let msg = xous::receive_message(status_sid).unwrap();

0 commit comments

Comments
 (0)