debugging

This commit is contained in:
2025-07-18 20:31:23 +01:00
parent 491b1982e8
commit ee88e956d9

View File

@@ -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("<no message avaliable>")
)
.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)