From 817e758f7c5e4dc2ad389e752d9e4aa3789ce1f0 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 6 Nov 2022 03:36:43 +0800 Subject: [PATCH] remove the dead-wait before the PDDB is mounted the "right" way to do this is to poll to see if trusted init is done. once that is done, you can go ahead and try to mount the PDDB. --- services/shellchat/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/shellchat/src/main.rs b/services/shellchat/src/main.rs index 11ab93350..061d31fc3 100644 --- a/services/shellchat/src/main.rs +++ b/services/shellchat/src/main.rs @@ -426,7 +426,11 @@ fn wrapped_main() -> ! { let main_conn = xous::connect(shch_sid).unwrap(); move || { let tt = ticktimer_server::Ticktimer::new().unwrap(); - tt.sleep_ms(500).ok(); // give some time for the system to finish booting + let xns = xous_names::XousNames::new().unwrap(); + let gam = gam::Gam::new(&xns).unwrap(); + while !gam.trusted_init_done().unwrap() { + tt.sleep_ms(50).ok(); + } loop { let (no_retry_failure, count) = pddb::Pddb::new().try_mount(); pddb_init_done.store(true, Ordering::SeqCst);