add multiple momentary layers

This commit is contained in:
2025-12-28 20:59:08 +01:00
parent 150c52f620
commit 5012c6d494
3 changed files with 172 additions and 50 deletions

View File

@@ -36,7 +36,7 @@ pub fn init_display(bus: I2c<'static, embassy_rp::peripherals::I2C0, embassy_rp:
/// Temp function which updates the display with currently pressed keys
pub fn update_display(
display: &mut Option<Display>,
pressed_keys: &[(usize, usize, crate::keymap::KeyCode)],
pressed_keys: &[(usize, usize, crate::keymap::Action)],
) -> Option<()> {
if let Some(display) = display {
display.clear(BinaryColor::Off).ok()?;
@@ -54,7 +54,7 @@ pub fn update_display(
let mut y_pos = 0;
for (row_idx, col_idx, keycode) in pressed_keys.iter().take(3) {
let mut msg = heapless::String::<32>::new();
write!(&mut msg, "R{}C{}: 0x{:02X}", row_idx, col_idx, keycode.as_u8()).ok();
write!(&mut msg, "R{}C{}: 0x{:?}", row_idx, col_idx, keycode).ok();
Text::with_baseline(&msg, Point::new(0, y_pos), text_style, Baseline::Top)
.draw(display)