fix: prevent RMT peripheral drop on V4, log WS2812 errors

The Rmt struct was being dropped after extracting channel0, which
likely disabled the RMT peripheral. Use ManuallyDrop to keep it alive.
Also log WS2812 transmit errors instead of silently discarding them.
This commit is contained in:
swaits committed 2026-04-07 11:48:34 -06:00
1 parent 6558350aee
commit 239e72d0a8
2 files changed
+15 -6

No files matched your search

+3 -1
View File
@@ -43,6 +43,8 @@ impl Ws2812 {
impl RgbLed for Ws2812 {
async fn set_rgb(&mut self, r: u8, g: u8, b: u8) {
let data = Self::encode(r, g, b);
let _ = self.channel.transmit(&data).await;
if let Err(e) = self.channel.transmit(&data).await {
defmt::warn!("WS2812 transmit error: {}", e);
}
}
}