From ee88e956d92260dafe4c286f928bf7c9066f9aa9 Mon Sep 17 00:00:00 2001 From: Hexa Dust Date: Fri, 18 Jul 2025 20:31:23 +0100 Subject: [PATCH] debugging --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d34fc0d..e922122 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,10 +41,11 @@ fn panic(info: &core::panic::PanicInfo) -> ! { if let Some(loc) = info.location() { ufmt::uwriteln!( &mut serial, - " At {}:{}:{}\r", + " At {}:{}:{} - {}\r", loc.file(), loc.line(), loc.column(), + info.message().as_str().unwrap_or("") ) .unwrap_infallible(); } @@ -523,6 +524,7 @@ impl Show for NumberInput { } } +#[derive(uDebug)] enum State { EnterSignificant, EnterExponent, @@ -596,7 +598,7 @@ fn main() -> ! { let key = key.and_then(|(no, kn, ko)| InputKey::map(no, kn, ko)); if let Some(key) = debounce.input(key) { - ufmt::uwriteln!(&mut serial, "key: {:?}", key).unwrap_infallible(); + ufmt::uwriteln!(&mut serial, "key: {:?} state: {:?}", key, state).unwrap_infallible(); let res = match state { State::EnterSignificant => match key { InputKey::C => Ok(number_input.reset()), @@ -666,6 +668,7 @@ fn main() -> ! { state = State::Err } + ufmt::uwriteln!(&mut serial, "state: {:?}", state).unwrap_infallible(); match state { State::EnterSignificant | State::EnterExponent | State::EnterOperation => { number_input.show(&mut display)