fix: resolve display stuck after disconnect and radio task deadlock
- Set disconnected flag on DisplayCommand::Reset to block stale radio status updates from re-rendering dashboard over splash screen - Send StopRx to radio when USB DTR drops so radio stops generating packets after host disconnects - Use try_send for unsolicited responses (RxPacket, error recovery, StopRx Ok) to prevent radio task deadlock on full response channel - Fall back to LED-only event loop when display init fails instead of returning early and orphaning the LED Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
6 files changed
+114
-12
No files matched your search
+10
-2
@@ -131,8 +131,15 @@ pub async fn display_task(
|
||||
};
|
||||
|
||||
let Some(mut display) = crate::board::create_display(parts.i2c).await else {
|
||||
defmt::error!("display init failed, giving up");
|
||||
return;
|
||||
defmt::error!("display init failed, running LED-only loop");
|
||||
loop {
|
||||
match display_commands.receive().await {
|
||||
DisplayCommand::Reset | DisplayCommand::Off => {
|
||||
led.set_rgb(0, 0, 0).await;
|
||||
}
|
||||
DisplayCommand::On => {}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let mut state = DisplayState::new();
|
||||
@@ -207,6 +214,7 @@ pub async fn display_task(
|
||||
}
|
||||
DisplayCommand::Reset => {
|
||||
state = DisplayState::new();
|
||||
state.disconnected = true;
|
||||
render::splash(&mut display, &board_info);
|
||||
let _ = display.flush().await;
|
||||
led.set_rgb(0, 0, 0).await;
|
||||
|
||||
Reference in new issue
Block a user