Skip to content

Commit

Permalink
Report key rollover when it happens
Browse files Browse the repository at this point in the history
  • Loading branch information
bschwind committed Jul 12, 2024
1 parent 6298694 commit 4d4d33b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions firmware/src/key_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use defmt::Format;
#[derive(Copy, Clone, Format, PartialEq)]
pub enum KeyCode {
Empty = 0x0,
ErrorRollOver = 0x01,
A = 0x04,
B = 0x05,
C = 0x06,
Expand Down
4 changes: 4 additions & 0 deletions firmware/src/key_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ impl<const NUM_ROWS: usize, const NUM_COLS: usize> From<KeyScan<NUM_ROWS, NUM_CO
if keycode_index < keycodes.len() {
keycodes[keycode_index] = key;
keycode_index += 1;
} else {
for keycode in &mut keycodes {
*keycode = KeyCode::ErrorRollOver as u8;
}
}
};

Expand Down

0 comments on commit 4d4d33b

Please sign in to comment.