refactor: complete hsmc conversion and add debug-checkpoint feature
Finishes the hsmc migration that was staged across the prior two commits: - Radio task is now a single `machine.run().await`; all I/O lives in state-scoped `during:` activities (`next_command`, `next_packet`, `perform_tx`). The old `push/drain` helpers, the imperative top-level `select`, `handle_cmd`, `handle_rx_result`, and `execute_transmit` are gone. `StartingRx` / `ResumingRx` intermediate states model the host-visible difference between a responding and a silent RX re-arm. - Host/USB task is now an hsmc statechart (Disconnected/Connected) with entry/exit actions handling display wake, radio StopRx, and display reset — replacing the open-coded `was_connected` edge detector. The `protocol_loop` keeps its imperative read path because `read_packet` blocks. - New `debug-checkpoint` cargo feature ships a dedicated `debug_blink.rs` task and a shared atomic counter that code along the boot/dispatch/TX path bumps at notable points. A ladder-latching write policy preserves the deepest TX phase reached on the first attempt until reboot — diagnostic output for UART-only boards where defmt would corrupt the host protocol. Zero footprint when the feature is off. - Silence a stray `clippy::unit_arg` on `led_off` / `led_blip` in the display task for boards with `LedDriver = ()`.
This commit is contained in:
7 files changed
+902
-438
No files matched your search
@@ -96,6 +96,13 @@ owo-colors = "4.3"
|
||||
# macro's `#[cfg(feature = "tokio")]` checks.
|
||||
embassy = []
|
||||
tokio = []
|
||||
# When enabled, replaces the display task with a LED-based diagnostic
|
||||
# blinker driven by `crate::debug_blink::CHECKPOINT`. Used for diagnosing
|
||||
# the firmware on UART-only boards where defmt output would corrupt the
|
||||
# host protocol on the same UART. The LED flashes N times then pauses —
|
||||
# a human watches the pattern and reports N to determine where execution
|
||||
# reached / stopped.
|
||||
debug-checkpoint = []
|
||||
heltec_v3 = [
|
||||
"embassy",
|
||||
"dep:esp-backtrace",
|
||||
|
||||
Reference in new issue
Block a user