chase down some bugs

noted there is a heisenbug on the ticktimer, it only manifests
when the log level is at info. go figure!
This commit is contained in:
bunnie 2021-05-01 02:26:28 +08:00
parent 174b88f13d
commit 087bb39ea7
5 changed files with 8 additions and 5 deletions

View file

@ -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}
}

View file

@ -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();
}

View file

@ -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();

View file

@ -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);
}

View file

@ -493,7 +493,7 @@ fn xmain() -> ! {
let mut sleep_heap: BinaryHeap<SleepRequest, U32, Min> = 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")