From ad4a3ef3f22d28f70e679efb47aefb5ae6b18e1a Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 6 May 2025 19:07:25 +0800 Subject: [PATCH] KB_C2 pin just died? KB_C2 pin on this test board just got shorted to ground internally in the chip. I think it may have been due to power glitches when the ammeter was switching modes feeding through and causing trouble for the system. Anyawys, disable that row and remap some keys so we can continue with testing. MPW boards will hopefully be retired soon enough... --- loader/src/platform/cramium/update.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/loader/src/platform/cramium/update.rs b/loader/src/platform/cramium/update.rs index ca7737f09..418681f9f 100644 --- a/loader/src/platform/cramium/update.rs +++ b/loader/src/platform/cramium/update.rs @@ -80,9 +80,10 @@ pub fn scan_keyboard( if iox.get_gpio_pin_value(*col_port, *col_pin) == IoxValue::Low { if key_press_index < key_presses.len() { key_presses[key_press_index] = match (row, col) { - (0, 2) => KeyPress::Select, + (0, 2) => KeyPress::None, // KeyPress::Select, None due to broken hardware (2, 1) => KeyPress::Start, - (1, 2) => KeyPress::Left, + (1, 2) => KeyPress::None, // KeyPress::Left, None due to broken hardware + (2, 2) => KeyPress::None, // None due to broken hardware (1, 1) => KeyPress::Up, (0, 1) => KeyPress::Down, (2, 0) => KeyPress::Right, @@ -126,7 +127,7 @@ pub fn process_update(perclk: u32) { Mono::White.into(), Mono::Black.into(), ); - gfx::msg(&mut sh1107, " SELECT to update", Point::new(0, 115), Mono::White.into(), Mono::Black.into()); + gfx::msg(&mut sh1107, " DOWN to update", Point::new(0, 115), Mono::White.into(), Mono::Black.into()); sh1107.draw(); @@ -142,7 +143,7 @@ pub fn process_update(perclk: u32) { crate::println!("Got key: {:?}", kp); key_pressed = true; } - if kp == KeyPress::Select { + if kp == KeyPress::Down { do_update = true; } } @@ -196,7 +197,7 @@ pub fn process_update(perclk: u32) { loop { let kps = scan_keyboard(&iox_kbd, &rows, &cols); // only consider the first key returned in case of multi-key hit, for simplicity - if kps[0] == KeyPress::Select { + if kps[0] == KeyPress::Down { break; } else if kps[0] != KeyPress::None { crate::println!("Got key {:?}; ignoring", kps[0]); @@ -224,7 +225,7 @@ pub fn process_update(perclk: u32) { ); gfx::msg( &mut sh1107, - "Press SELECT", + "Press DOWN", Point::new(22, TEXT_MIDLINE + 18), Mono::Black.into(), Mono::White.into(),