From 5fabcd2ca7142f8a2d561a5ecbf027f288a8df93 Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 1 Feb 2023 15:00:22 +0800 Subject: [PATCH] track failed suspend attempts --- services/shellchat/src/cmds/sleep.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/shellchat/src/cmds/sleep.rs b/services/shellchat/src/cmds/sleep.rs index c64fc3b52..42a3217bc 100644 --- a/services/shellchat/src/cmds/sleep.rs +++ b/services/shellchat/src/cmds/sleep.rs @@ -90,13 +90,15 @@ impl<'a> ShellCmdApi<'a> for Sleep { let trng = trng::Trng::new(&xns).unwrap(); ticktimer.sleep_ms(1500).unwrap(); let mut iters = 0; + let mut timeouts = 0; loop { - log::info!("suspend/resume cycle: {}", iters); - llio.set_wakeup_alarm(4).unwrap(); + log::info!("suspend/resume cycle: {} ({} timeouts)", iters, timeouts); + llio.set_wakeup_alarm(5).unwrap(); ticktimer.sleep_ms(1000).ok(); match susres.initiate_suspend() { Err(xous::Error::Timeout) => { - log::warn!("Couldn't suspend, a server was blocking suspend.\n"); + timeouts += 1; + log::warn!("Couldn't suspend, a server was blocking suspend. ({}/{})\n", timeouts, iters); } Ok(_) => {}, Err(e) => {