diff --git a/buildpush.sh b/buildpush.sh index cb400bf83..c0b6a0406 100755 --- a/buildpush.sh +++ b/buildpush.sh @@ -58,8 +58,10 @@ set -- "${POSITIONAL[@]}" DESTDIR=code/precursors cargo xtask hw-image ../betrusted-soc/build/software/soc.svd -cp ../betrusted-soc/build/software/soc.svd svd2utra/examples/soc.svd -cp ../betrusted-soc/build/software/soc.svd emulation/renode.svd + +# only copy if changed, othrewise it seems to trigger extra build effort... +rsync -a --no-times --checksum ../betrusted-soc/build/software/soc.svd svd2utra/examples/soc.svd +rsync -a --no-times --checksum ../betrusted-soc/build/software/soc.svd emulation/renode.svd if [ $? -ne 0 ] then diff --git a/services/keyboard/Cargo.toml b/services/keyboard/Cargo.toml index 1bd398c17..d047febda 100644 --- a/services/keyboard/Cargo.toml +++ b/services/keyboard/Cargo.toml @@ -7,7 +7,7 @@ description = "Manage keyboard input" [dependencies] xous = { path = "../../xous-rs" } -heapless = "0.5" +heapless = "0.5.6" log-server = { path = "../log-server" } ticktimer-server = { path = "../ticktimer-server" } xous-names = { path = "../xous-names" } diff --git a/services/keyboard/src/api.rs b/services/keyboard/src/api.rs index 83064ea41..ff1a553b5 100644 --- a/services/keyboard/src/api.rs +++ b/services/keyboard/src/api.rs @@ -157,7 +157,7 @@ impl core::convert::TryFrom<& Message> for Opcode { unsafe { *( (m.buf.as_mut_ptr()) as *mut xous_names::api::Registration) } })) } else { - Err("KBD api: unknown MutableBorrow ID") + Err("KBD api: unknown Borrow ID") } }, _ => Err("KBD api: unhandled message type"), diff --git a/services/keyboard/src/lib.rs b/services/keyboard/src/lib.rs index 3ab67c2c7..b41525bc6 100644 --- a/services/keyboard/src/lib.rs +++ b/services/keyboard/src/lib.rs @@ -11,13 +11,9 @@ fn request_core(name: &str, kbd_conn: xous::CID, subtype: u8) -> Result Result { diff --git a/services/keyboard/src/main.rs b/services/keyboard/src/main.rs index 99712b176..7e8fb7a61 100644 --- a/services/keyboard/src/main.rs +++ b/services/keyboard/src/main.rs @@ -282,18 +282,22 @@ mod implementation { /// which is structured as (row : col), where each of row and col are a u8. /// Option "none" means no keys were pressed during this scan. fn kbd_getcodes(&self) -> Option> { - let mut keys = Vec::new(); + let mut keys: Vec<(usize, usize), U16> = Vec::new(); for r in 0..KBD_ROWS { let cols: u16 = self.kbd_getrow(r as u8); for c in 0..KBD_COLS { if (cols & (1 << c)) != 0 { + info!("KBD: kbd_getcodes() pushing r{} c{}", r, c); keys.push( (r, c) ).unwrap(); } } } if keys.len() > 0 { + for &(r, c) in keys.iter() { + info!("KBD: verified r{} c{}", r, c); + } Some(keys) } else { None @@ -340,15 +344,16 @@ mod implementation { // if there's keys pressed, continue to increment the debounce counter if let Some(code) = &self.lastcode { - for (row, col) in code.iter() { - if self.debounce[*row][*col] < self.threshold { - self.debounce[*row][*col] += increment; + for &(row, col) in code.iter() { + info!("Debouncing row{} col{}", row, col); + if self.debounce[row][col] < self.threshold { + self.debounce[row][col] += increment; // now check if we've passed the debounce threshold, and report a keydown - if self.debounce[*row][*col] >= self.threshold { - keydowns.push((*row,*col)).expect("KBD hw: probably ran out of space to track keydowns"); + if self.debounce[row][col] >= self.threshold { + keydowns.push((row,col)).expect("KBD hw: probably ran out of space to track keydowns"); } } - downs[*row][*col] = true; // record that we processed the key + downs[row][col] = true; // record that we processed the key } }