refactor: unify SimpleLed via embedded-hal, remove Option<L> from BoardParts
- Added embedded-hal 1.0 as direct dep (already transitive via embedded-hal-async) - SimpleLed<P: OutputPin> now generic over any HAL — single definition in driver/ - Removed duplicate SimpleLed from board/esp32s3.rs and board/wio_tracker_l1.rs - Changed BoardParts.led from Option<L> to L — boards with no LED use () - Display task calls led.set_rgb() unconditionally (no-op for () boards) - RAK board: led: () instead of led: None
This commit is contained in:
1 parent
f9117d71c8
commit
41b5775268
12 files changed
+50
-59
No files matched your search
@@ -18,20 +18,6 @@ use crate::hal::esp32s3 as mcu;
|
||||
|
||||
pub use mcu::{I2cBus as DisplayI2c, SpiBus};
|
||||
|
||||
// ── LED driver ──────────────────────────────────────────────────────
|
||||
|
||||
pub struct SimpleLed(pub Output<'static>);
|
||||
|
||||
impl super::traits::RgbLed for SimpleLed {
|
||||
async fn set_rgb(&mut self, r: u8, g: u8, b: u8) {
|
||||
if r > 0 || g > 0 || b > 0 {
|
||||
self.0.set_high();
|
||||
} else {
|
||||
self.0.set_low();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── Concrete peripheral types ───────────────────────────────────────
|
||||
|
||||
type Nss = Output<'static>;
|
||||
|
||||
Reference in new issue
Block a user