diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9407c872c2..a34b51eebd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: # Subsequent steps can just check the examples instead, as we're already # confident that they link. - name: check esp32-hal (common features) - run: cd esp32-hal/ && cargo check --examples --features=eh1,smartled,ufmt + run: cd esp32-hal/ && cargo check --examples --features=eh1,ufmt - name: check esp32-hal (async) run: cd esp32-hal/ && cargo check --example=embassy_hello_world --features=embassy,embassy-time-timg0 - name: check esp32-hal (async, gpio) @@ -107,7 +107,7 @@ jobs: # Subsequent steps can just check the examples instead, as we're already # confident that they link. - name: check esp32c3-hal (common features) - run: cd esp32c3-hal/ && cargo check --examples --features=eh1,smartled,ufmt + run: cd esp32c3-hal/ && cargo check --examples --features=eh1,ufmt - name: check esp32c3-hal (async, systick) run: cd esp32c3-hal/ && cargo check --example=embassy_hello_world --features=embassy,embassy-time-systick - name: check esp32c3-hal (async, timg0) @@ -140,7 +140,7 @@ jobs: # Subsequent steps can just check the examples instead, as we're already # confident that they link. - name: check esp32c6-hal (common features) - run: cd esp32c6-hal/ && cargo check --examples --features=eh1,smartled,ufmt + run: cd esp32c6-hal/ && cargo check --examples --features=eh1,ufmt - name: check esp32c6-hal (async, systick) run: cd esp32c6-hal/ && cargo check --example=embassy_hello_world --features=embassy,embassy-time-systick - name: check esp32c6-hal (async, timg0) @@ -169,7 +169,7 @@ jobs: # Subsequent steps can just check the examples instead, as we're already # confident that they link. - name: check esp32s2-hal (common features) - run: cd esp32s2-hal/ && cargo check --examples --features=eh1,smartled,ufmt + run: cd esp32s2-hal/ && cargo check --examples --features=eh1,ufmt # FIXME: `time-systick` feature disabled for now, see 'esp32s2-hal/Cargo.toml'. # - name: check esp32s2-hal (async, systick) # run: cd esp32s2-hal/ && cargo check --example=embassy_hello_world --features=embassy,embassy-time-systick @@ -203,7 +203,7 @@ jobs: # Subsequent steps can just check the examples instead, as we're already # confident that they link. - name: check esp32s3-hal (common features) - run: cd esp32s3-hal/ && cargo check --examples --features=eh1,smartled,ufmt + run: cd esp32s3-hal/ && cargo check --examples --features=eh1,ufmt - name: check esp32s3-hal (async, systick) run: cd esp32s3-hal/ && cargo check --example=embassy_hello_world --features=embassy,embassy-time-systick - name: check esp32s3-hal (async, timg0) @@ -230,9 +230,9 @@ jobs: - name: msrv (esp32c2-hal) run: cd esp32c2-hal/ && cargo check --features=eh1,ufmt - name: msrv (esp32c3-hal) - run: cd esp32c3-hal/ && cargo check --features=eh1,ufmt,smartled + run: cd esp32c3-hal/ && cargo check --features=eh1,ufmt - name: msrv (esp32c6-hal) - run: cd esp32c6-hal/ && cargo check --features=eh1,ufmt,smartled + run: cd esp32c6-hal/ && cargo check --features=eh1,ufmt msrv-xtensa: runs-on: ubuntu-latest @@ -247,11 +247,11 @@ jobs: # Verify the MSRV for all Xtensa chips. - name: msrv (esp32-hal) - run: cd esp32-hal/ && cargo check --features=eh1,ufmt,smartled + run: cd esp32-hal/ && cargo check --features=eh1,ufmt - name: msrv (esp32s2-hal) - run: cd esp32s2-hal/ && cargo check --features=eh1,ufmt,smartled + run: cd esp32s2-hal/ && cargo check --features=eh1,ufmt - name: msrv (esp32s3-hal) - run: cd esp32s3-hal/ && cargo check --features=eh1,ufmt,smartled + run: cd esp32s3-hal/ && cargo check --features=eh1,ufmt # -------------------------------------------------------------------------- # Lint @@ -327,4 +327,4 @@ jobs: - name: rustfmt (esp32s2-hal) run: cargo fmt --all --manifest-path=esp32s2-hal/Cargo.toml -- --check - name: rustfmt (esp32s3-hal) - run: cargo fmt --all --manifest-path=esp32s3-hal/Cargo.toml -- --check \ No newline at end of file + run: cargo fmt --all --manifest-path=esp32s3-hal/Cargo.toml -- --check diff --git a/esp-hal-common/Cargo.toml b/esp-hal-common/Cargo.toml index 98ce16eff8e..6e678af6c7f 100644 --- a/esp-hal-common/Cargo.toml +++ b/esp-hal-common/Cargo.toml @@ -43,9 +43,6 @@ riscv-atomic-emulation-trap = { version = "0.4.0", optional = true } xtensa-lx = { version = "0.8.0", optional = true } xtensa-lx-rt = { version = "0.15.0", optional = true } -# Smart-LED (e.g., WS2812/SK68XX) support -smart-leds-trait = { version = "0.2.1", optional = true } - # Part of `ufmt` containing only `uWrite` trait ufmt-write = { version = "0.1.0", optional = true } @@ -76,9 +73,6 @@ esp32c2_26mhz = [] # Implement the `embedded-hal==1.0.0-alpha.x` traits eh1 = ["embedded-hal-1", "embedded-hal-nb", "embedded-can"] -# To use the external `smart_led` crate -smartled = ["smart-leds-trait"] - # To support `ufmt` ufmt = ["ufmt-write"] diff --git a/esp-hal-common/src/lib.rs b/esp-hal-common/src/lib.rs index 7da63c82770..35c64cbfe0e 100644 --- a/esp-hal-common/src/lib.rs +++ b/esp-hal-common/src/lib.rs @@ -102,8 +102,6 @@ pub mod twai; pub mod uart; #[cfg(usb_serial_jtag)] pub mod usb_serial_jtag; -#[cfg(rmt)] -pub mod utils; /// State of the CPU saved when entering exception or interrupt pub mod trapframe { diff --git a/esp-hal-common/src/utils/mod.rs b/esp-hal-common/src/utils/mod.rs deleted file mode 100644 index 4338692394b..00000000000 --- a/esp-hal-common/src/utils/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -//! Helper Utils - -// Only provide adapter when feature is enabled! -#[cfg(feature = "smartled")] -pub mod smart_leds_adapter; -#[cfg(feature = "smartled")] -pub use smart_leds_adapter::SmartLedsAdapter; - -// Re-export the macro that due to the macro_export configuration was already exported -// in the root module (i.e., `esp-hal-common`) -#[cfg(feature = "smartled")] -pub use crate::smartLedAdapter; diff --git a/esp-hal-smartled/Cargo.toml b/esp-hal-smartled/Cargo.toml new file mode 100644 index 00000000000..6cdb78cf7b5 --- /dev/null +++ b/esp-hal-smartled/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "esp-hal-smartled" +version = "0.1.0" +edition = "2021" +description = "RMT adapter for smartleds" +repository = "https://github.com/esp-rs/esp-hal" +license = "MIT OR Apache-2.0" + +[dependencies] +esp-hal-common = { version = "0.7.1", features = [], path = "../esp-hal-common" } +fugit = "0.3.6" +smart-leds-trait = "0.2.1" + +[features] +esp32 = ["esp-hal-common/esp32"] +esp32c3 = ["esp-hal-common/esp32c3"] +esp32c6 = ["esp-hal-common/esp32c6"] +esp32s2 = ["esp-hal-common/esp32s2"] +esp32s3 = ["esp-hal-common/esp32s3"] + +esp32_26mhz = ["esp-hal-common/esp32_26mhz"] +esp32_40mhz = ["esp-hal-common/esp32_40mhz"] diff --git a/esp-hal-smartled/README.md b/esp-hal-smartled/README.md new file mode 100644 index 00000000000..b0f15cc37af --- /dev/null +++ b/esp-hal-smartled/README.md @@ -0,0 +1,27 @@ +# esp-hal-smartled + +[![Crates.io](https://img.shields.io/crates/v/esp-hal-smartled?labelColor=1C2C2E&color=C96329&logo=Rust&style=flat-square)](https://crates.io/crates/esp-hal-smartled) +[![docs.rs](https://img.shields.io/docsrs/esp-hal-smartled?labelColor=1C2C2E&color=C96329&logo=rust&style=flat-square)](https://docs.rs/esp-hal-smartled) +![Crates.io](https://img.shields.io/crates/l/esp-hal-smartled?labelColor=1C2C2E&style=flat-square) +[![Matrix](https://img.shields.io/matrix/esp-rs:matrix.org?label=join%20matrix&labelColor=1C2C2E&color=BEC5C9&logo=matrix&style=flat-square)](https://matrix.to/#/#esp-rs:matrix.org) + +This adapter allows for the use of an RMT output channel to easily interact with RGB LEDs and use the convenience functions of the [`smart-leds`](https://crates.io/crates/smart-leds) crate. + +## [Documentation] + +[documentation]: https://docs.rs/esp-hal-smartled/ + +## License + +Licensed under either of: + +- Apache License, Version 2.0 ([LICENSE-APACHE](../LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) +- MIT license ([LICENSE-MIT](../LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in +the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without +any additional terms or conditions. diff --git a/esp-hal-common/src/utils/smart_leds_adapter.rs b/esp-hal-smartled/src/lib.rs similarity index 94% rename from esp-hal-common/src/utils/smart_leds_adapter.rs rename to esp-hal-smartled/src/lib.rs index 4c7cd468acb..766fcbfed53 100644 --- a/esp-hal-common/src/utils/smart_leds_adapter.rs +++ b/esp-hal-smartled/src/lib.rs @@ -1,7 +1,7 @@ //! # Smart-LEDs RMT Adapter //! //! This adapter allows for the use of an RMT output channel to easily interact -//! with RGB LEDs and use the convenience functions of the external +//! with RGB LEDs and use the convenience functions of the //! [`smart-leds`](https://crates.io/crates/smart-leds) crate. //! //! _This is a simple implementation where every LED is adressed in an @@ -9,35 +9,36 @@ //! but in case this is used in combination with interrupts that might disturb //! the sequential sending, an alternative implementation (addressing the LEDs //! in a sequence in a single RMT send operation) might be required!_ + +#![no_std] #![deny(missing_docs)] use core::slice::IterMut; -use fugit::NanosDuration; -use smart_leds_trait::{SmartLedsWrite, RGB8}; - -#[cfg(any(esp32, esp32s2))] -use crate::pulse_control::ClockSource; -use crate::{ +#[cfg(any(feature = "esp32", feature = "esp32s2"))] +use esp_hal_common::pulse_control::ClockSource; +use esp_hal_common::{ gpio::OutputPin, peripheral::Peripheral, pulse_control::{ConfiguredChannel, OutputChannel, PulseCode, RepeatMode, TransmissionError}, }; +use fugit::NanosDuration; +use smart_leds_trait::{SmartLedsWrite, RGB8}; // Specifies what clock frequency we're using for the RMT peripheral (if // properly configured) // // TODO: Factor in clock configuration, this needs to be revisited once #24 and // #44 have been addressed. -#[cfg(esp32c3)] +#[cfg(feature = "esp32")] const SOURCE_CLK_FREQ: u32 = 40_000_000; -#[cfg(esp32c6)] +#[cfg(feature = "esp32c3")] const SOURCE_CLK_FREQ: u32 = 40_000_000; -#[cfg(esp32s2)] +#[cfg(feature = "esp32c6")] const SOURCE_CLK_FREQ: u32 = 40_000_000; -#[cfg(esp32)] +#[cfg(feature = "esp32s2")] const SOURCE_CLK_FREQ: u32 = 40_000_000; -#[cfg(esp32s3)] +#[cfg(feature = "esp32s3")] const SOURCE_CLK_FREQ: u32 = 40_000_000; const SK68XX_CODE_PERIOD: u32 = 1200; @@ -101,14 +102,14 @@ where where UnconfiguredChannel: OutputChannel = CHANNEL>, { - #[cfg(any(esp32c3, esp32c6, esp32s3))] + #[cfg(not(any(feature = "esp32", feature = "esp32s2")))] channel .set_idle_output_level(false) .set_carrier_modulation(false) .set_channel_divider(1) .set_idle_output(true); - #[cfg(any(esp32, esp32s2))] + #[cfg(any(feature = "esp32", feature = "esp32s2"))] channel .set_idle_output_level(false) .set_carrier_modulation(false) diff --git a/esp-hal.code-workspace b/esp-hal.code-workspace index 03134b729f1..ff6498aacff 100644 --- a/esp-hal.code-workspace +++ b/esp-hal.code-workspace @@ -6,6 +6,9 @@ { "path": "esp-hal-procmacros" }, + { + "path": "esp-hal-smartled" + }, { "path": "esp32-hal" }, diff --git a/esp32-hal/Cargo.toml b/esp32-hal/Cargo.toml index c04bbfec87f..f74b7aa16a0 100644 --- a/esp32-hal/Cargo.toml +++ b/esp32-hal/Cargo.toml @@ -37,6 +37,7 @@ critical-section = "1.1.1" embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] } embedded-graphics = "0.7.1" esp-backtrace = { version = "0.6.0", features = ["esp32", "panic-handler", "exception-handler", "print-uart"] } +esp-hal-smartled = { version = "0.1.0", features = ["esp32"], path = "../esp-hal-smartled" } esp-println = { version = "0.3.1", features = ["esp32"] } sha2 = { version = "0.10.6", default-features = false} smart-leds = "0.3.0" @@ -45,22 +46,17 @@ static_cell = "1.0.0" aes = "0.8.2" [features] -default = ["rt", "vectored", "xtal40mhz"] -bluetooth = [] -eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb"] -rt = [] -smartled = ["esp-hal-common/smartled"] -ufmt = ["esp-hal-common/ufmt"] -vectored = ["esp-hal-common/vectored"] -async = ["esp-hal-common/async", "embedded-hal-async"] -embassy = ["esp-hal-common/embassy"] +default = ["rt", "vectored", "xtal40mhz"] +bluetooth = [] +eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb"] +rt = [] +ufmt = ["esp-hal-common/ufmt"] +vectored = ["esp-hal-common/vectored"] +async = ["esp-hal-common/async", "embedded-hal-async"] +embassy = ["esp-hal-common/embassy"] embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz-1_000_000"] -xtal40mhz = ["esp-hal-common/esp32_40mhz"] -xtal26mhz = ["esp-hal-common/esp32_26mhz"] - -[[example]] -name = "hello_rgb" -required-features = ["smartled"] +xtal40mhz = ["esp-hal-common/esp32_40mhz"] +xtal26mhz = ["esp-hal-common/esp32_26mhz"] [[example]] name = "spi_eh1_loopback" diff --git a/esp32-hal/examples/hello_rgb.rs b/esp32-hal/examples/hello_rgb.rs index 3650dfc7f21..279f2474e96 100644 --- a/esp32-hal/examples/hello_rgb.rs +++ b/esp32-hal/examples/hello_rgb.rs @@ -18,7 +18,6 @@ use esp32_hal::{ peripherals, prelude::*, timer::TimerGroup, - utils::{smartLedAdapter, SmartLedsAdapter}, Delay, PulseControl, Rtc, @@ -26,6 +25,7 @@ use esp32_hal::{ }; #[allow(unused_imports)] use esp_backtrace as _; +use esp_hal_smartled::{smartLedAdapter, SmartLedsAdapter}; use smart_leds::{ brightness, gamma, diff --git a/esp32c3-hal/Cargo.toml b/esp32c3-hal/Cargo.toml index e2e264755e1..e21c153bc5a 100644 --- a/esp32c3-hal/Cargo.toml +++ b/esp32c3-hal/Cargo.toml @@ -41,6 +41,7 @@ critical-section = "1.1.1" embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] } embedded-graphics = "0.7.1" esp-backtrace = { version = "0.6.0", features = ["esp32c3", "panic-handler", "exception-handler", "print-uart"] } +esp-hal-smartled = { version = "0.1.0", features = ["esp32c3"], path = "../esp-hal-smartled" } esp-println = { version = "0.3.1", features = ["esp32c3"] } sha2 = { version = "0.10.6", default-features = false} smart-leds = "0.3.0" @@ -53,7 +54,6 @@ mcu-boot = [] direct-boot = [] eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb", "dep:embedded-can"] rt = [] -smartled = ["esp-hal-common/smartled"] ufmt = ["esp-hal-common/ufmt"] vectored = ["esp-hal-common/vectored"] allow-opt-level-z = [] @@ -62,10 +62,6 @@ embassy = ["esp-hal-common/embassy"] embassy-time-systick = ["esp-hal-common/embassy-time-systick", "embassy-time/tick-hz-16_000_000"] embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz-1_000_000"] -[[example]] -name = "hello_rgb" -required-features = ["smartled"] - [[example]] name = "spi_eh1_loopback" required-features = ["eh1"] diff --git a/esp32c3-hal/examples/hello_rgb.rs b/esp32c3-hal/examples/hello_rgb.rs index c891c636302..ccf7dce8bbe 100644 --- a/esp32c3-hal/examples/hello_rgb.rs +++ b/esp32c3-hal/examples/hello_rgb.rs @@ -17,7 +17,6 @@ use esp32c3_hal::{ prelude::*, pulse_control::ClockSource, timer::TimerGroup, - utils::{smartLedAdapter, SmartLedsAdapter}, Delay, PulseControl, Rtc, @@ -25,6 +24,7 @@ use esp32c3_hal::{ }; #[allow(unused_imports)] use esp_backtrace as _; +use esp_hal_smartled::{smartLedAdapter, SmartLedsAdapter}; use smart_leds::{ brightness, gamma, diff --git a/esp32c6-hal/Cargo.toml b/esp32c6-hal/Cargo.toml index a83357c00fe..a84719097f7 100644 --- a/esp32c6-hal/Cargo.toml +++ b/esp32c6-hal/Cargo.toml @@ -42,6 +42,7 @@ critical-section = "1.1.1" embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] } embedded-graphics = "0.7.1" esp-backtrace = { version = "0.6.0", features = ["esp32c6", "panic-handler", "exception-handler", "print-uart"] } +esp-hal-smartled = { version = "0.1.0", features = ["esp32c6"], path = "../esp-hal-smartled" } esp-println = { version = "0.4.0", features = ["esp32c6"] } sha2 = { version = "0.10.6", default-features = false} smart-leds = "0.3.0" @@ -53,7 +54,6 @@ default = ["rt", "vectored"] direct-boot = [] eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb", "dep:embedded-can"] rt = [] -smartled = ["esp-hal-common/smartled"] ufmt = ["esp-hal-common/ufmt"] vectored = ["esp-hal-common/vectored"] async = ["esp-hal-common/async", "embedded-hal-async"] @@ -61,10 +61,6 @@ embassy = ["esp-hal-common/embassy"] embassy-time-systick = ["esp-hal-common/embassy-time-systick", "embassy-time/tick-hz-16_000_000"] embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz-1_000_000"] -[[example]] -name = "hello_rgb" -required-features = ["smartled"] - [[example]] name = "spi_eh1_loopback" required-features = ["eh1"] diff --git a/esp32c6-hal/examples/hello_rgb.rs b/esp32c6-hal/examples/hello_rgb.rs index 7ed5a70d2b2..6c5e3027170 100644 --- a/esp32c6-hal/examples/hello_rgb.rs +++ b/esp32c6-hal/examples/hello_rgb.rs @@ -16,13 +16,13 @@ use esp32c6_hal::{ prelude::*, pulse_control::ClockSource, timer::TimerGroup, - utils::{smartLedAdapter, SmartLedsAdapter}, Delay, PulseControl, Rtc, IO, }; use esp_backtrace as _; +use esp_hal_smartled::{smartLedAdapter, SmartLedsAdapter}; use smart_leds::{ brightness, gamma, diff --git a/esp32s2-hal/Cargo.toml b/esp32s2-hal/Cargo.toml index 54a928ca1a1..0cf3e8b1433 100644 --- a/esp32s2-hal/Cargo.toml +++ b/esp32s2-hal/Cargo.toml @@ -38,6 +38,7 @@ critical-section = "1.1.1" embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] } embedded-graphics = "0.7.1" esp-backtrace = { version = "0.6.0", features = ["esp32s2", "panic-handler", "print-uart", "exception-handler"] } +esp-hal-smartled = { version = "0.1.0", features = ["esp32s2"], path = "../esp-hal-smartled" } esp-println = { version = "0.3.1", features = ["esp32s2"] } sha2 = { version = "0.10.6", default-features = false} smart-leds = "0.3.0" @@ -51,7 +52,6 @@ aes = "0.8.2" default = ["rt", "vectored"] eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb"] rt = [] -smartled = ["esp-hal-common/smartled"] ufmt = ["esp-hal-common/ufmt"] vectored = ["esp-hal-common/vectored"] async = ["esp-hal-common/async", "embedded-hal-async"] @@ -62,10 +62,6 @@ embassy = ["esp-hal-common/embassy"] # embassy-time-systick = ["esp-hal-common/embassy-time-systick", "embassy-time/tick-hz-1_000_000"] embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz-1_000_000"] -[[example]] -name = "hello_rgb" -required-features = ["smartled"] - [[example]] name = "spi_eh1_loopback" required-features = ["eh1"] diff --git a/esp32s2-hal/examples/hello_rgb.rs b/esp32s2-hal/examples/hello_rgb.rs index 39fe8c4bb52..1a30d64497b 100644 --- a/esp32s2-hal/examples/hello_rgb.rs +++ b/esp32s2-hal/examples/hello_rgb.rs @@ -16,7 +16,6 @@ use esp32s2_hal::{ peripherals::Peripherals, prelude::*, timer::TimerGroup, - utils::{smartLedAdapter, SmartLedsAdapter}, Delay, PulseControl, Rtc, @@ -24,6 +23,7 @@ use esp32s2_hal::{ }; #[allow(unused_imports)] use esp_backtrace as _; +use esp_hal_smartled::{smartLedAdapter, SmartLedsAdapter}; use smart_leds::{ brightness, gamma, diff --git a/esp32s3-hal/Cargo.toml b/esp32s3-hal/Cargo.toml index 0bcda72cdc6..82a6629359d 100644 --- a/esp32s3-hal/Cargo.toml +++ b/esp32s3-hal/Cargo.toml @@ -40,6 +40,7 @@ critical-section = "1.1.1" embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] } embedded-graphics = "0.7.1" esp-backtrace = { version = "0.6.0", features = ["esp32s3", "panic-handler", "exception-handler", "print-uart"] } +esp-hal-smartled = { version = "0.1.0", features = ["esp32s3"], path = "../esp-hal-smartled" } esp-println = { version = "0.3.1", features = ["esp32s3"] } sha2 = { version = "0.10.6", default-features = false} smart-leds = "0.3.0" @@ -54,7 +55,6 @@ default = ["rt", "vectored"] direct-boot = ["r0"] eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb", "dep:embedded-can"] rt = [] -smartled = ["esp-hal-common/smartled"] ufmt = ["esp-hal-common/ufmt"] vectored = ["esp-hal-common/vectored"] async = ["esp-hal-common/async", "embedded-hal-async"] @@ -62,10 +62,6 @@ embassy = ["esp-hal-common/embassy"] embassy-time-systick = ["esp-hal-common/embassy-time-systick", "embassy-time/tick-hz-16_000_000"] embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz-1_000_000"] -[[example]] -name = "hello_rgb" -required-features = ["smartled"] - [[example]] name = "spi_eh1_loopback" required-features = ["eh1"] diff --git a/esp32s3-hal/examples/hello_rgb.rs b/esp32s3-hal/examples/hello_rgb.rs index 85267ad71a5..89e15daa66b 100644 --- a/esp32s3-hal/examples/hello_rgb.rs +++ b/esp32s3-hal/examples/hello_rgb.rs @@ -17,7 +17,6 @@ use esp32s3_hal::{ prelude::*, pulse_control::ClockSource, timer::TimerGroup, - utils::{smartLedAdapter, SmartLedsAdapter}, Delay, PulseControl, Rtc, @@ -25,6 +24,7 @@ use esp32s3_hal::{ }; #[allow(unused_imports)] use esp_backtrace as _; +use esp_hal_smartled::{smartLedAdapter, SmartLedsAdapter}; use smart_leds::{ brightness, gamma,