From 087bb39ea7f0a36b570c6d22bfd03f1f83170a19 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 1 May 2021 02:26:28 +0800 Subject: [PATCH] chase down some bugs noted there is a heisenbug on the ticktimer, it only manifests when the log level is at info. go figure! --- services/keyboard/src/main.rs | 2 +- services/rkyv-test-client/src/main.rs | 6 ++++-- services/susres/src/lib.rs | 1 + services/susres/src/main.rs | 2 +- services/ticktimer-server/src/main.rs | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/services/keyboard/src/main.rs b/services/keyboard/src/main.rs index 63c69a501..9e756804c 100644 --- a/services/keyboard/src/main.rs +++ b/services/keyboard/src/main.rs @@ -156,7 +156,7 @@ fn map_qwerty(code: RowCol) -> ScanCode { (6, 4) => ScanCode{key: Some('↑'), shift: Some('↑'), hold: None, alt: Some('↑')}, (8, 2) => ScanCode{key: Some('↓'), shift: Some('↓'), hold: None, alt: Some('↓')}, // this one is OK - (5, 2) => ScanCode{key: Some('∴'), shift: Some('∴'), hold: None, alt: Some('∴')}, + (3, 6) => ScanCode{key: Some('∴'), shift: Some('∴'), hold: None, alt: Some('∴')}, _ => ScanCode {key: None, shift: None, hold: None, alt: None} } diff --git a/services/rkyv-test-client/src/main.rs b/services/rkyv-test-client/src/main.rs index bfc7c4539..1b4ba4565 100644 --- a/services/rkyv-test-client/src/main.rs +++ b/services/rkyv-test-client/src/main.rs @@ -73,10 +73,12 @@ fn rkyv_test_client() -> ! { log::info!("Sending a string \"{}\"", sent_str); rkyv_test_server::log_message("prefix", sent_str); - com.req_batt_stats().unwrap(); + if (idx %2) == 0 { + com.req_batt_stats().unwrap(); + } // let the loop run a bit, then try a suspend - if idx == 0 { + if idx == 3 { // TODO: add a self-wakeup RTC alarm once we're beyond the touch-and-go phase susres.initiate_suspend().unwrap(); } diff --git a/services/susres/src/lib.rs b/services/susres/src/lib.rs index a7e9fc8df..403079b21 100644 --- a/services/susres/src/lib.rs +++ b/services/susres/src/lib.rs @@ -88,6 +88,7 @@ fn suspend_cb_server(sid0: usize, sid1: usize, sid2: usize, sid3: usize) { match FromPrimitive::from_usize(msg.body.id()) { Some(SuspendEventCallback::Event) => msg_scalar_unpack!(msg, cid, id, token, _, { // directly pass the scalar message onto the CID with the ID memorized in the original hook + log::info!("PID {} has s/r token {}", xous::current_pid().unwrap().get(), token); send_message(cid as u32, Message::new_scalar(id, token, 0, 0, 0) ).unwrap(); diff --git a/services/susres/src/main.rs b/services/susres/src/main.rs index 1b6beadb5..0635f9882 100644 --- a/services/susres/src/main.rs +++ b/services/susres/src/main.rs @@ -72,7 +72,7 @@ mod implementation { if sr.csr.rf(utra::susres::STATE_RESUME) == 0 { println!("going into suspend"); - if true { // this is just for testing + if true { // this is just for testing, doing a quick full-soc boot instead of a power down let mut reboot_csr = CSR::new(REBOOT_CSR.load(Ordering::Relaxed) as *mut u32); reboot_csr.wfo(utra::reboot::SOC_RESET_SOC_RESET, 0xAC); } diff --git a/services/ticktimer-server/src/main.rs b/services/ticktimer-server/src/main.rs index 6254af793..c7fa383f8 100644 --- a/services/ticktimer-server/src/main.rs +++ b/services/ticktimer-server/src/main.rs @@ -493,7 +493,7 @@ fn xmain() -> ! { let mut sleep_heap: BinaryHeap = BinaryHeap::new(); log_server::init_wait().unwrap(); - log::set_max_level(log::LevelFilter::Info); + log::set_max_level(log::LevelFilter::Trace); info!("my PID is {}", xous::process::id()); let ticktimer_server = xous::create_server_with_address(b"ticktimer-server")