checkpoint: vendored esp-hal-smartled with widened esp-hal bound

This commit is contained in:
Matt Spencer committed 2026-10-17 15:49:50 +01:00
1 parent e021ab751a
commit 1ec7408f8e
7 files changed
+45 -96

No files matched your search

+9 -13
View File
@@ -4,7 +4,7 @@
mod config;
mod encoder;
mod light;
mod ws2812;
mod strip;
mod zigbee_stack;
use embassy_embedded_hal::adapter::BlockingAsync;
@@ -15,10 +15,9 @@ use esp_hal::gpio::InputConfig;
use esp_hal::gpio::Pull;
use esp_hal::interrupt::software::SoftwareInterruptControl;
use esp_hal::rmt::Rmt;
use esp_hal::rmt::TxChannelConfig;
use esp_hal::rmt::TxChannelCreator;
use esp_hal::time::Rate;
use esp_hal::timer::timg::TimerGroup;
use esp_hal_smartled::WS2812B_TIMING;
use esp_radio::ieee802154::Ieee802154;
use esp_storage::FlashStorage;
use static_cell::StaticCell;
@@ -28,7 +27,7 @@ use crate::config::STEPS_PER_BRIGHTNESS_UNIT;
use crate::encoder::EVENTS;
use crate::encoder::EncoderEvent;
use crate::light::Mode;
use crate::ws2812::Ws2812;
use crate::strip::Strip;
use crate::zigbee_stack::Stack;
esp_bootloader_esp_idf::esp_app_desc!();
@@ -52,17 +51,14 @@ async fn main(spawner: embassy_executor::Spawner) -> ! {
esp_alloc::heap_allocator!(size: 32 * 1024);
// 80 MHz with a divider of 1 gives the 12.5 ns tick the WS2812B bit
// timings in `ws2812` are expressed in
let rmt = Rmt::new(peripherals.RMT, Rate::from_mhz(80))
// the adapter derives its pulse timings from this frequency, so the same
// rate has to be handed to both calls
let rmt_freq = Rate::from_mhz(80);
let rmt = Rmt::new(peripherals.RMT, rmt_freq)
.expect("init RMT")
.into_async();
let rmt_channel = rmt
.channel0
.configure_tx(&TxChannelConfig::default().with_clk_divider(1))
.expect("configure RMT TX")
.with_pin(peripherals.GPIO2);
let strip = Ws2812::new(rmt_channel);
let strip = Strip::new(WS2812B_TIMING, rmt.channel0, peripherals.GPIO2, rmt_freq)
.expect("configure WS2812B adapter");
// the encoder's common pin is grounded, so both phases and the switch idle
// high and are driven low; the pull-ups make an open contact well defined