Skip to content

Go through .unwrap() statements, fail gracefully instead #48

@brainstorm

Description

@brainstorm

This GlitchOcurred panic can happen anytime there's a transient in serial lines (not often, but the chip should not completely halt).

Go through those and produce an event+fail and continue working gracefully as much as possible.

====================== PANIC ======================
panicked at /Users/rvalls/dev/personal/ssh-stamp/src/espressif/buffered_uart.rs:53:72:
called `Result::unwrap()` on an `Err` value: GlitchOccurred

Backtrace:

0x420401f4
core::result::unwrap_failed
    at /Users/rvalls/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/result.rs:1704
0x4201eb90
core::result::Result<T,E>::unwrap
    at /Users/rvalls/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/result.rs:1109
0x4201d880
embassy_executor::raw::util::SyncUnsafeCell<T>::get
    at /Users/rvalls/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/embassy-executor-0.7.0/src/raw/util.rs:55
0x408008c4
esp_hal::interrupt::riscv::vectored::handle_interrupt
    at /Users/rvalls/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/esp-hal-1.0.0-beta.1/src/interrupt/riscv.rs:513
0x40800258
0x42051596
core::task::wake::Waker::wake_by_ref
    at /Users/rvalls/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/task/wake.rs:465
0x408008c4
esp_hal::interrupt::riscv::vectored::handle_interrupt
    at /Users/rvalls/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/esp-hal-1.0.0-beta.1/src/interrupt/riscv.rs:513
0x40800258
0x4201d72a
embassy_executor::raw::util::SyncUnsafeCell<T>::get
    at /Users/rvalls/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/embassy-executor-0.7.0/src/raw/util.rs:55
0x4203b8c8
main
    at /Users/rvalls/dev/personal/ssh-stamp/src/main.rs:25

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions