fix: V4 also has plain LED on GPIO35, not WS2812 on GPIO38

Per the official V4 schematic (HTIT-WB32LAF_V4.3.pdf), the V4 has
an orange LED on GPIO35 with a series resistor — same setup as V3.
GPIO38 is GNSS_RX on V4, not an LED. Neither V3 nor V4 has a WS2812.

- V4: switched from WS2812/GPIO38 to SimpleLed/GPIO35
- Removed ws2812.rs driver (no current board uses addressable LEDs)
- All ESP boards now use the same SimpleLed driver on GPIO35
This commit is contained in:
swaits committed 2026-04-07 11:59:05 -06:00
1 parent eb880d03f6
commit 3bb41da223
3 files changed
+8 -86

No files matched your search

+7 -18
View File
@@ -1,11 +1,9 @@
use esp_hal::gpio::{Level, Output, OutputConfig};
use esp_hal::rmt::{Rmt, TxChannelConfig, TxChannelCreator};
use esp_hal::time::Rate;
use static_cell::StaticCell;
use super::esp32s3;
use super::traits::{BoardParts, LoRaBoard};
use crate::driver::ws2812::Ws2812;
use crate::driver::simple_led::SimpleLed;
use crate::hal::esp32s3 as mcu;
pub use super::esp32s3::{
@@ -14,7 +12,7 @@ pub use super::esp32s3::{
pub type UsbDriver = esp_hal::otg_fs::asynch::Driver<'static>;
pub type LedDriver = Ws2812;
pub type LedDriver = SimpleLed;
pub struct UsbParts {
pub driver: UsbDriver,
@@ -32,7 +30,7 @@ impl LoRaBoard for Board {
type CommParts = UsbParts;
type DisplayParts = DisplayParts;
type DisplayDriver = DisplayDriver;
type LedDriver = Ws2812;
type LedDriver = LedDriver;
fn init() -> Self {
let p = esp_hal::init(esp_hal::Config::default());
@@ -43,7 +41,7 @@ impl LoRaBoard for Board {
mcu::mac_address()
}
fn into_parts(self) -> BoardParts<RadioParts, UsbParts, DisplayParts, Ws2812> {
fn into_parts(self) -> BoardParts<RadioParts, UsbParts, DisplayParts, LedDriver> {
let p = self.p;
mcu::start_timer(p.TIMG0);
@@ -77,18 +75,9 @@ impl LoRaBoard for Board {
let i2c = mcu::init_i2c(p.I2C0, p.GPIO17, p.GPIO18);
let display = Some(DisplayParts { i2c });
// WS2812B RGB LED on GPIO38 via RMT channel 0 (blocking, ~31µs per update)
let rmt = Rmt::new(p.RMT, Rate::from_mhz(80)).expect("RMT init");
let led_channel = rmt
.channel0
.configure_tx(
p.GPIO38,
TxChannelConfig::default()
.with_clk_divider(1)
.with_idle_output(true),
)
.expect("RMT TX channel init");
let led = Some(Ws2812::new(led_channel));
// Orange LED on GPIO35
let led_pin = Output::new(p.GPIO35, Level::Low, OutputConfig::default());
let led = Some(SimpleLed::new(led_pin));
BoardParts {
radio,