fix: Wio Tracker LED on P1.01, move SimpleLed to board layer
Per the Wio Tracker L1 schematic, it has a green LED on P1.01. Moved SimpleLed from driver/ to board layer (esp32s3.rs and wio_tracker_l1.rs) since the impl needs HAL-specific Output types. Removed driver/simple_led.rs — each board layer defines its own. RAK WisBlock remains LedDriver=() (no user LED on the core module).
This commit is contained in:
1 parent
3bb41da223
commit
f9117d71c8
7 files changed
+43
-41
No files matched your search
@@ -1,5 +1,2 @@
|
||||
#[cfg(feature = "wio_tracker_l1")]
|
||||
pub mod sh1106;
|
||||
|
||||
#[cfg(any(feature = "heltec_v3", feature = "heltec_v3_uart", feature = "heltec_v4"))]
|
||||
pub mod simple_led;
|
||||
@@ -1,28 +0,0 @@
|
||||
//! Simple single-color LED driver (GPIO on/off).
|
||||
//!
|
||||
//! For boards with a plain LED (not addressable RGB). Any non-zero
|
||||
//! RGB value turns the LED on; all zeros turns it off.
|
||||
|
||||
use esp_hal::gpio::Output;
|
||||
|
||||
use crate::board::RgbLed;
|
||||
|
||||
pub struct SimpleLed {
|
||||
pin: Output<'static>,
|
||||
}
|
||||
|
||||
impl SimpleLed {
|
||||
pub fn new(pin: Output<'static>) -> Self {
|
||||
Self { pin }
|
||||
}
|
||||
}
|
||||
|
||||
impl RgbLed for SimpleLed {
|
||||
async fn set_rgb(&mut self, r: u8, g: u8, b: u8) {
|
||||
if r > 0 || g > 0 || b > 0 {
|
||||
self.pin.set_high();
|
||||
} else {
|
||||
self.pin.set_low();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user