diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index 23863eb2b95..8a9f8a01f82 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - Removed `NoPinType` in favour of `DummyPin`. (#2068) +- Removed the `async`, `embedded-hal-02`, `embedded-hal`, `embedded-io`, `embedded-io-async`, and `ufmt` features (#2070) ## [0.20.1] - 2024-08-30 diff --git a/esp-hal/Cargo.toml b/esp-hal/Cargo.toml index e8cf9e9a277..2090fa79a13 100644 --- a/esp-hal/Cargo.toml +++ b/esp-hal/Cargo.toml @@ -11,7 +11,7 @@ links = "esp-hal" [package.metadata.docs.rs] default-target = "riscv32imac-unknown-none-elf" -features = ["embedded-hal", "esp32c6"] +features = ["esp32c6"] rustdoc-args = ["--cfg", "docsrs"] [dependencies] @@ -24,17 +24,17 @@ defmt = { version = "0.3.8", optional = true } delegate = "0.12.0" digest = { version = "0.10.7", default-features = false, optional = true } document-features = "0.2.10" -embassy-futures = { version = "0.1.1", optional = true } -embassy-sync = { version = "0.6.0", optional = true } +embassy-futures = "0.1.1" +embassy-sync = "0.6.0" embassy-usb-driver = { version = "0.1.0", optional = true } embassy-usb-synopsys-otg = { version = "0.1.0", optional = true } -embedded-can = { version = "0.4.1", optional = true } -embedded-hal-02 = { version = "0.2.7", optional = true, features = ["unproven"], package = "embedded-hal" } -embedded-hal = { version = "1.0.0", optional = true } -embedded-hal-async = { version = "1.0.0", optional = true } -embedded-hal-nb = { version = "1.0.0", optional = true } -embedded-io = { version = "0.6.1", optional = true } -embedded-io-async = { version = "0.6.1", optional = true } +embedded-can = "0.4.1" +embedded-hal-02 = { version = "0.2.7", features = ["unproven"], package = "embedded-hal" } +embedded-hal = "1.0.0" +embedded-hal-async = "1.0.0" +embedded-hal-nb = "1.0.0" +embedded-io = "0.6.1" +embedded-io-async = "0.6.1" enumset = "1.1.5" esp-synopsys-usb-otg = { version = "0.4.2", optional = true, features = ["fs", "esp32sx"] } fugit = "0.3.7" @@ -48,7 +48,7 @@ strum = { version = "0.26.3", default-features = false, featu void = { version = "1.0.2", default-features = false } usb-device = { version = "0.3.2", optional = true } rand_core = "0.6.4" -ufmt-write = { version = "0.1.0", optional = true } +ufmt-write = "0.1.0" xtensa-lx = { version = "0.9.0", optional = true } # IMPORTANT: @@ -76,14 +76,14 @@ esp-metadata = { version = "0.3.0", path = "../esp-metadata" } serde = { version = "1.0.209", features = ["derive"] } [features] -default = ["embedded-hal"] +default = [] riscv = ["dep:riscv", "critical-section/restore-state-u8"] xtensa = ["dep:xtensa-lx", "critical-section/restore-state-u32"] bluetooth = [] -usb-otg = ["esp-synopsys-usb-otg", "usb-device"] +usb-otg = ["dep:embassy-usb-driver", "dep:embassy-usb-synopsys-otg", "dep:esp-synopsys-usb-otg", "dep:usb-device"] __esp_hal_embassy = [] @@ -124,27 +124,14 @@ esp32s3 = ["dep:esp32s3", "xtensa", "procmacros/has-ulp-core", "xtensa-lx/spin", flip-link = ["esp-riscv-rt/fix-sp"] #! ### Trait Implementation Feature Flags -## Enable support for asynchronous operation, with interfaces provided by -## `embedded-hal-async` and `embedded-io-async`. -## Also enables `embassy-usb` support for ESP32-S2 and ESP32-S3. -async = [ - "embedded-hal", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "embassy-sync", - "embassy-futures", - "embassy-usb-driver", - "embassy-usb-synopsys-otg" -] ## Implement `defmt::Format` on certain types. defmt = [ "dep:defmt", - "embassy-futures?/defmt", - "embassy-sync?/defmt", - "embedded-hal?/defmt-03", + "embassy-futures/defmt", + "embassy-sync/defmt", + "embedded-hal/defmt-03", "embedded-io/defmt-03", - "embedded-io-async?/defmt-03", + "embedded-io-async/defmt-03", "esp32?/defmt", "esp32c2?/defmt", "esp32c3?/defmt", @@ -153,15 +140,6 @@ defmt = [ "esp32s2?/defmt", "esp32s3?/defmt", ] -## Implement the traits defined in the `1.0.0` releases of `embedded-hal` and -## `embedded-hal-nb` for the relevant peripherals. -embedded-hal = ["dep:embedded-hal", "dep:embedded-hal-nb", "dep:embedded-can"] -## Implement the traits defined in the `0.2.x` release of `embedded-hal`. -embedded-hal-02 = ["dep:embedded-hal-02"] -## Implement the traits defined in `embedded-io` for certain peripherals. -embedded-io = ["dep:embedded-io"] -## Implement the `ufmt_write::uWrite` trait for certain peripherals. -ufmt = ["dep:ufmt-write"] #! ### PSRAM Feature Flags ## Use externally connected PSRAM (2MB). @@ -184,7 +162,7 @@ opsram-8m = [] opsram-16m = [] # This feature is intended for testing; you probably don't want to enable it: -ci = ["async", "embedded-hal-02", "embedded-io", "ufmt", "defmt", "bluetooth", "place-spi-driver-in-ram"] +ci = ["defmt", "bluetooth", "place-spi-driver-in-ram"] [lints.clippy] mixed_attributes_style = "allow" diff --git a/esp-hal/MIGRATING-0.20.md b/esp-hal/MIGRATING-0.20.md index 0714b5a81e6..c7a836fcdd8 100644 --- a/esp-hal/MIGRATING-0.20.md +++ b/esp-hal/MIGRATING-0.20.md @@ -1,8 +1,19 @@ -Migration Guide from 0.20.x to vNext -==================================== +# Migration Guide from 0.20.x to vNext -HAL initialsation ------------------ +## Cargo Features + +A number of trait implementations which were previously feature-gated are now implemented by default. The following Cargo features have been removed: + +- `async` +- `embedded-hal-02` +- `embedded-hal` +- `embedded-io` +- `embedded-io-async` +- `ufmt` + +If your project enables any of these features, simply remove them from your Cargo manifest and things should continue to work as expected. + +## HAL Initialisation Instead of manually grabbing peripherals and setting up clocks, you should now call `esp_hal::init`. @@ -13,7 +24,7 @@ Instead of manually grabbing peripherals and setting up clocks, you should now c prelude::*, - system::SystemControl, }; - + #[entry] fn main() -> ! { - let peripherals = Peripherals::take(); diff --git a/esp-hal/src/analog/adc/esp32.rs b/esp-hal/src/analog/adc/esp32.rs index ec6bdac107e..585e27f75c7 100644 --- a/esp-hal/src/analog/adc/esp32.rs +++ b/esp-hal/src/analog/adc/esp32.rs @@ -343,7 +343,6 @@ impl<'d, ADC1> Adc<'d, ADC1> { } } -#[cfg(feature = "embedded-hal-02")] impl<'d, ADCI, PIN> embedded_hal_02::adc::OneShot> for Adc<'d, ADCI> where diff --git a/esp-hal/src/analog/adc/mod.rs b/esp-hal/src/analog/adc/mod.rs index 7a1aa62413f..417f0f70077 100644 --- a/esp-hal/src/analog/adc/mod.rs +++ b/esp-hal/src/analog/adc/mod.rs @@ -110,7 +110,6 @@ pub struct AdcPin { _phantom: PhantomData, } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::adc::Channel for AdcPin where PIN: embedded_hal_02::adc::Channel, @@ -260,7 +259,6 @@ macro_rules! impl_adc_interface { const CHANNEL: u8 = $channel; } - #[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::adc::Channel for crate::gpio::$pin { type ID = u8; diff --git a/esp-hal/src/analog/adc/riscv.rs b/esp-hal/src/analog/adc/riscv.rs index 45952dfe78c..1f91eef0265 100644 --- a/esp-hal/src/analog/adc/riscv.rs +++ b/esp-hal/src/analog/adc/riscv.rs @@ -530,7 +530,6 @@ impl super::AdcCalEfuse for crate::peripherals::ADC2 { } } -#[cfg(feature = "embedded-hal-02")] impl<'d, ADCI, PIN, CS> embedded_hal_02::adc::OneShot> for Adc<'d, ADCI> where diff --git a/esp-hal/src/analog/adc/xtensa.rs b/esp-hal/src/analog/adc/xtensa.rs index 631466f526e..215d0815ba5 100644 --- a/esp-hal/src/analog/adc/xtensa.rs +++ b/esp-hal/src/analog/adc/xtensa.rs @@ -590,7 +590,6 @@ impl super::AdcCalEfuse for crate::peripherals::ADC2 { } } -#[cfg(feature = "embedded-hal-02")] impl<'d, ADCI, PIN, CS> embedded_hal_02::adc::OneShot> for Adc<'d, ADCI> where diff --git a/esp-hal/src/delay.rs b/esp-hal/src/delay.rs index c15c6e66ae6..4ce5d0d6421 100644 --- a/esp-hal/src/delay.rs +++ b/esp-hal/src/delay.rs @@ -45,7 +45,6 @@ use crate::clock::Clocks; #[non_exhaustive] pub struct Delay; -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::blocking::delay::DelayMs for Delay where T: Into, @@ -55,7 +54,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::blocking::delay::DelayUs for Delay where T: Into, @@ -65,7 +63,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal::delay::DelayNs for Delay { fn delay_ns(&mut self, ns: u32) { self.delay_nanos(ns); diff --git a/esp-hal/src/dma/gdma.rs b/esp-hal/src/dma/gdma.rs index 1c7ed6f6064..bc13f42f419 100644 --- a/esp-hal/src/dma/gdma.rs +++ b/esp-hal/src/dma/gdma.rs @@ -420,23 +420,18 @@ impl RegisterAccess for Channel { #[doc(hidden)] pub struct ChannelTxImpl {} -#[cfg(feature = "async")] use embassy_sync::waitqueue::AtomicWaker; -#[cfg(feature = "async")] #[allow(clippy::declare_interior_mutable_const)] const INIT: AtomicWaker = AtomicWaker::new(); -#[cfg(feature = "async")] static TX_WAKERS: [AtomicWaker; CHANNEL_COUNT] = [INIT; CHANNEL_COUNT]; -#[cfg(feature = "async")] static RX_WAKERS: [AtomicWaker; CHANNEL_COUNT] = [INIT; CHANNEL_COUNT]; impl crate::private::Sealed for ChannelTxImpl {} impl TxChannel> for ChannelTxImpl { - #[cfg(feature = "async")] fn waker() -> &'static AtomicWaker { &TX_WAKERS[N as usize] } @@ -449,7 +444,6 @@ pub struct ChannelRxImpl {} impl crate::private::Sealed for ChannelRxImpl {} impl RxChannel> for ChannelRxImpl { - #[cfg(feature = "async")] fn waker() -> &'static AtomicWaker { &RX_WAKERS[N as usize] } @@ -551,7 +545,6 @@ macro_rules! impl_channel { /// /// Descriptors should be sized as `(CHUNK_SIZE + 4091) / 4092`. I.e., to /// transfer buffers of size `1..=4092`, you need 1 descriptor. - #[cfg(feature = "async")] pub fn configure_for_async<'a>( self, burst_mode: bool, @@ -578,23 +571,19 @@ macro_rules! impl_channel { cfg_if::cfg_if! { if #[cfg(esp32c2)] { - #[cfg(feature = "async")] const CHANNEL_COUNT: usize = 1; impl_channel!(0, super::asynch::interrupt::interrupt_handler_ch0, DMA_CH0); } else if #[cfg(esp32c3)] { - #[cfg(feature = "async")] const CHANNEL_COUNT: usize = 3; impl_channel!(0, super::asynch::interrupt::interrupt_handler_ch0, DMA_CH0); impl_channel!(1, super::asynch::interrupt::interrupt_handler_ch1, DMA_CH1); impl_channel!(2, super::asynch::interrupt::interrupt_handler_ch2, DMA_CH2); } else if #[cfg(any(esp32c6, esp32h2))] { - #[cfg(feature = "async")] const CHANNEL_COUNT: usize = 3; impl_channel!(0, super::asynch::interrupt::interrupt_handler_ch0, DMA_IN_CH0, DMA_OUT_CH0); impl_channel!(1, super::asynch::interrupt::interrupt_handler_ch1, DMA_IN_CH1, DMA_OUT_CH1); impl_channel!(2, super::asynch::interrupt::interrupt_handler_ch2, DMA_IN_CH2, DMA_OUT_CH2); } else if #[cfg(esp32s3)] { - #[cfg(feature = "async")] const CHANNEL_COUNT: usize = 5; impl_channel!(0, super::asynch::interrupt::interrupt_handler_ch0, DMA_IN_CH0, DMA_OUT_CH0); impl_channel!(1, super::asynch::interrupt::interrupt_handler_ch1, DMA_IN_CH1, DMA_OUT_CH1); diff --git a/esp-hal/src/dma/mod.rs b/esp-hal/src/dma/mod.rs index 059bd98b1a1..7cfe3df7bf8 100644 --- a/esp-hal/src/dma/mod.rs +++ b/esp-hal/src/dma/mod.rs @@ -1249,7 +1249,6 @@ pub trait RxPrivate: crate::private::Sealed { fn clear_interrupts(&self); - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker; } @@ -1296,7 +1295,6 @@ where R::is_in_done() } - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker; } @@ -1494,7 +1492,6 @@ where CH::Channel::clear_in_interrupts(); } - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker { CH::Rx::waker() } @@ -1552,7 +1549,6 @@ pub trait TxPrivate: crate::private::Sealed { fn clear_interrupts(&self); - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker; fn descriptors_handled(&self) -> bool; @@ -1633,7 +1629,6 @@ where R::last_out_dscr_address() } - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker; } @@ -1759,7 +1754,6 @@ where CH::Channel::has_out_descriptor_error() } - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker { CH::Tx::waker() } @@ -2762,7 +2756,6 @@ where } } -#[cfg(feature = "async")] pub(crate) mod asynch { use core::task::Poll; diff --git a/esp-hal/src/dma/pdma.rs b/esp-hal/src/dma/pdma.rs index e4f702bbabd..051ab529d7f 100644 --- a/esp-hal/src/dma/pdma.rs +++ b/esp-hal/src/dma/pdma.rs @@ -356,7 +356,6 @@ macro_rules! ImplSpiChannel { impl $crate::private::Sealed for [] {} impl<'a> TxChannel<[]> for [] { - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker { static WAKER: embassy_sync::waitqueue::AtomicWaker = embassy_sync::waitqueue::AtomicWaker::new(); &WAKER @@ -370,7 +369,6 @@ macro_rules! ImplSpiChannel { impl $crate::private::Sealed for [] {} impl<'a> RxChannel<[]> for [] { - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker { static WAKER: embassy_sync::waitqueue::AtomicWaker = embassy_sync::waitqueue::AtomicWaker::new(); &WAKER @@ -408,7 +406,6 @@ macro_rules! ImplSpiChannel { /// /// Descriptors should be sized as `(CHUNK_SIZE + 4091) / 4092`. I.e., to /// transfer buffers of size `1..=4092`, you need 1 descriptor. - #[cfg(feature = "async")] pub fn configure_for_async<'a>( self, burst_mode: bool, @@ -752,7 +749,6 @@ macro_rules! ImplI2sChannel { impl $crate::private::Sealed for [] {} impl<'a> TxChannel<[]> for [] { - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker { static WAKER: embassy_sync::waitqueue::AtomicWaker = embassy_sync::waitqueue::AtomicWaker::new(); &WAKER @@ -765,7 +761,6 @@ macro_rules! ImplI2sChannel { impl $crate::private::Sealed for [] {} impl<'a> RxChannel<[]> for [] { - #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker { static WAKER: embassy_sync::waitqueue::AtomicWaker = embassy_sync::waitqueue::AtomicWaker::new(); &WAKER @@ -802,7 +797,6 @@ macro_rules! ImplI2sChannel { /// /// Descriptors should be sized as `(CHUNK_SIZE + 4091) / 4092`. I.e., to /// transfer buffers of size `1..=4092`, you need 1 descriptor. - #[cfg(feature = "async")] pub fn configure_for_async<'a>( self, burst_mode: bool, diff --git a/esp-hal/src/gpio/dummy_pin.rs b/esp-hal/src/gpio/dummy_pin.rs index c26511af370..614132075f7 100644 --- a/esp-hal/src/gpio/dummy_pin.rs +++ b/esp-hal/src/gpio/dummy_pin.rs @@ -133,7 +133,6 @@ impl InputPin for DummyPin { fn disconnect_input_from_peripheral(&mut self, _signal: InputSignal, _: private::Internal) {} } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::digital::v2::OutputPin for DummyPin { type Error = core::convert::Infallible; @@ -146,7 +145,6 @@ impl embedded_hal_02::digital::v2::OutputPin for DummyPin { Ok(()) } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::digital::v2::StatefulOutputPin for DummyPin { fn is_set_high(&self) -> Result { Ok(OutputPin::is_set_high(self, private::Internal)) @@ -156,12 +154,10 @@ impl embedded_hal_02::digital::v2::StatefulOutputPin for DummyPin { } } -#[cfg(feature = "embedded-hal")] impl embedded_hal::digital::ErrorType for DummyPin { type Error = core::convert::Infallible; } -#[cfg(feature = "embedded-hal")] impl embedded_hal::digital::OutputPin for DummyPin { fn set_low(&mut self) -> Result<(), Self::Error> { self.set_output_high(true, private::Internal); @@ -174,7 +170,6 @@ impl embedded_hal::digital::OutputPin for DummyPin { } } -#[cfg(feature = "embedded-hal")] impl embedded_hal::digital::StatefulOutputPin for DummyPin { fn is_set_high(&mut self) -> Result { Ok(OutputPin::is_set_high(self, private::Internal)) diff --git a/esp-hal/src/gpio/mod.rs b/esp-hal/src/gpio/mod.rs index 97c188cfa5b..fef1fe145f6 100644 --- a/esp-hal/src/gpio/mod.rs +++ b/esp-hal/src/gpio/mod.rs @@ -1328,7 +1328,6 @@ extern "C" fn gpio_interrupt_handler() { user_handler.call(); } - #[cfg(feature = "async")] asynch::handle_gpio_interrupt(); } @@ -2786,7 +2785,6 @@ pub(crate) mod internal { } } -#[cfg(feature = "async")] mod asynch { use core::task::{Context, Poll}; @@ -2954,7 +2952,6 @@ mod asynch { } } -#[cfg(feature = "embedded-hal-02")] mod embedded_hal_02_impls { use embedded_hal_02::digital::v2 as digital; @@ -3249,7 +3246,6 @@ mod embedded_hal_02_impls { } } -#[cfg(feature = "embedded-hal")] mod embedded_hal_impls { use embedded_hal::digital; @@ -3499,8 +3495,6 @@ mod embedded_hal_impls { } } -#[cfg(feature = "embedded-hal")] -#[cfg(feature = "async")] mod embedded_hal_async_impls { use embedded_hal_async::digital::Wait; diff --git a/esp-hal/src/i2c.rs b/esp-hal/src/i2c.rs index d2c2ca0c6b0..774f855c560 100644 --- a/esp-hal/src/i2c.rs +++ b/esp-hal/src/i2c.rs @@ -95,7 +95,6 @@ pub enum Error { CommandNrExceeded, } -#[cfg(any(feature = "embedded-hal", feature = "async"))] #[derive(PartialEq)] // This enum is used to keep track of the last operation that was performed // in an embedded-hal(-async) I2C::transaction. It used to determine whether @@ -106,7 +105,6 @@ enum LastOpWas { None, } -#[cfg(feature = "embedded-hal")] impl embedded_hal::i2c::Error for Error { fn kind(&self) -> embedded_hal::i2c::ErrorKind { use embedded_hal::i2c::{ErrorKind, NoAcknowledgeSource}; @@ -203,7 +201,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::blocking::i2c::Read for I2C<'_, T, crate::Blocking> where T: Instance, @@ -215,7 +212,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::blocking::i2c::Write for I2C<'_, T, crate::Blocking> where T: Instance, @@ -227,7 +223,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::blocking::i2c::WriteRead for I2C<'_, T, crate::Blocking> where T: Instance, @@ -244,12 +239,10 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal::i2c::ErrorType for I2C<'_, T, DM> { type Error = Error; } -#[cfg(feature = "embedded-hal")] impl embedded_hal::i2c::I2c for I2C<'_, T, DM> where T: Instance, @@ -417,7 +410,6 @@ where } } -#[cfg(feature = "async")] impl<'d, T> I2C<'d, T, crate::Async> where T: Instance, @@ -464,7 +456,6 @@ where } } -#[cfg(feature = "async")] mod asynch { #[cfg(not(esp32))] use core::{ @@ -893,7 +884,6 @@ mod asynch { } } - #[cfg(feature = "embedded-hal")] impl<'d, T> embedded_hal_async::i2c::I2c for I2C<'d, T, crate::Async> where T: Instance, diff --git a/esp-hal/src/i2s.rs b/esp-hal/src/i2s.rs index ac390c9fde0..70598c88600 100644 --- a/esp-hal/src/i2s.rs +++ b/esp-hal/src/i2s.rs @@ -2181,7 +2181,6 @@ mod private { } /// Async functionality -#[cfg(feature = "async")] pub mod asynch { use super::{Error, I2sRx, I2sTx, RegisterAccess}; use crate::{ diff --git a/esp-hal/src/lcd_cam/lcd/i8080.rs b/esp-hal/src/lcd_cam/lcd/i8080.rs index 27af36a8578..f3770d93853 100644 --- a/esp-hal/src/lcd_cam/lcd/i8080.rs +++ b/esp-hal/src/lcd_cam/lcd/i8080.rs @@ -62,8 +62,6 @@ use core::{fmt::Formatter, marker::PhantomData, mem::size_of}; use fugit::HertzU32; -#[cfg(feature = "async")] -use crate::lcd_cam::asynch::LcdDoneFuture; use crate::{ clock::Clocks, dma::{ @@ -81,6 +79,7 @@ use crate::{ }, gpio::{OutputPin, OutputSignal}, lcd_cam::{ + asynch::LcdDoneFuture, lcd::{i8080::private::TxPins, ClockMode, DelayMode, Phase, Polarity}, private::calculate_clkm, BitOrder, @@ -378,7 +377,6 @@ where } } -#[cfg(feature = "async")] impl<'d, CH: DmaChannel, P: TxPins> I8080<'d, CH, P, crate::Async> where P::Word: Into, diff --git a/esp-hal/src/lcd_cam/mod.rs b/esp-hal/src/lcd_cam/mod.rs index 5bc898c8e9e..f14f021b3e0 100644 --- a/esp-hal/src/lcd_cam/mod.rs +++ b/esp-hal/src/lcd_cam/mod.rs @@ -63,7 +63,6 @@ impl<'d> InterruptConfigurable for LcdCam<'d, crate::Blocking> { } } -#[cfg(feature = "async")] impl<'d> LcdCam<'d, crate::Async> { /// Creates a new `LcdCam` instance for asynchronous operation. pub fn new_async(lcd_cam: impl Peripheral

+ 'd) -> Self { @@ -118,7 +117,6 @@ pub enum ByteOrder { } #[doc(hidden)] -#[cfg(feature = "async")] pub mod asynch { use core::task::Poll; @@ -173,13 +171,11 @@ pub mod asynch { } mod private { - #[cfg(feature = "async")] pub(crate) struct Instance; // NOTE: the LCD_CAM interrupt registers are shared between LCD and Camera and // this is only implemented for the LCD side, when the Camera is implemented a // CriticalSection will be needed to protect these shared registers. - #[cfg(feature = "async")] impl Instance { pub(crate) fn listen_lcd_done() { let lcd_cam = unsafe { crate::peripherals::LCD_CAM::steal() }; diff --git a/esp-hal/src/ledc/channel.rs b/esp-hal/src/ledc/channel.rs index aff67d1e6dc..a838fccc36d 100644 --- a/esp-hal/src/ledc/channel.rs +++ b/esp-hal/src/ledc/channel.rs @@ -294,7 +294,6 @@ where } } -#[cfg(feature = "embedded-hal")] mod ehal1 { use embedded_hal::pwm::{self, ErrorKind, ErrorType, SetDutyCycle}; diff --git a/esp-hal/src/lib.rs b/esp-hal/src/lib.rs index 1d73ba8dc13..44886ba9766 100644 --- a/esp-hal/src/lib.rs +++ b/esp-hal/src/lib.rs @@ -130,8 +130,7 @@ //! ## Feature Flags #![doc = document_features::document_features!(feature_label = r#"{feature}"#)] #![doc(html_logo_url = "https://avatars.githubusercontent.com/u/46717278")] -#![allow(asm_sub_register)] -#![cfg_attr(feature = "async", allow(stable_features, async_fn_in_trait))] +#![allow(asm_sub_register, async_fn_in_trait, stable_features)] #![cfg_attr(xtensa, feature(asm_experimental_arch))] #![deny(missing_docs, rust_2018_idioms)] #![no_std] diff --git a/esp-hal/src/mcpwm/operator.rs b/esp-hal/src/mcpwm/operator.rs index 9d08ac1966a..b21a3e050ef 100644 --- a/esp-hal/src/mcpwm/operator.rs +++ b/esp-hal/src/mcpwm/operator.rs @@ -414,7 +414,6 @@ impl<'d, Pin: OutputPin, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> } } -#[cfg(feature = "embedded-hal-02")] impl<'d, Pin: OutputPin, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> embedded_hal_02::PwmPin for PwmPin<'d, Pin, PWM, OP, IS_A> { @@ -449,7 +448,6 @@ impl<'d, Pin: OutputPin, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> emb } /// Implement no error type for the PwmPin because the method are infallible -#[cfg(feature = "embedded-hal")] impl<'d, Pin: OutputPin, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> embedded_hal::pwm::ErrorType for PwmPin<'d, Pin, PWM, OP, IS_A> { @@ -457,7 +455,6 @@ impl<'d, Pin: OutputPin, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> } /// Implement the trait SetDutyCycle for PwmPin -#[cfg(feature = "embedded-hal")] impl<'d, Pin: OutputPin, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> embedded_hal::pwm::SetDutyCycle for PwmPin<'d, Pin, PWM, OP, IS_A> { diff --git a/esp-hal/src/otg_fs.rs b/esp-hal/src/otg_fs.rs index 802de2a37f7..22a4c9b0fe5 100644 --- a/esp-hal/src/otg_fs.rs +++ b/esp-hal/src/otg_fs.rs @@ -132,7 +132,6 @@ unsafe impl<'d> UsbPeripheral for Usb<'d> { } } /// Async functionality -#[cfg(feature = "async")] pub mod asynch { use embassy_usb_driver::{ EndpointAddress, diff --git a/esp-hal/src/parl_io.rs b/esp-hal/src/parl_io.rs index b1d89623e07..9cd74eb562a 100644 --- a/esp-hal/src/parl_io.rs +++ b/esp-hal/src/parl_io.rs @@ -1660,7 +1660,6 @@ where } #[doc(hidden)] -#[cfg(feature = "async")] pub mod asynch { use core::task::Poll; @@ -2045,7 +2044,6 @@ mod private { reg_block.rx_cfg0().read().rx_eof_gen_sel().bit_is_set() } - #[cfg(feature = "async")] pub fn listen_tx_done() { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; @@ -2053,7 +2051,6 @@ mod private { reg_block.int_ena().modify(|_, w| w.tx_eof().set_bit()); } - #[cfg(feature = "async")] pub fn unlisten_tx_done() { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; @@ -2061,7 +2058,6 @@ mod private { reg_block.int_ena().modify(|_, w| w.tx_eof().clear_bit()); } - #[cfg(feature = "async")] pub fn is_listening_tx_done() -> bool { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; @@ -2069,7 +2065,6 @@ mod private { reg_block.int_ena().read().tx_eof().bit() } - #[cfg(feature = "async")] pub fn is_tx_done_set() -> bool { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; @@ -2077,7 +2072,6 @@ mod private { reg_block.int_raw().read().tx_eof().bit() } - #[cfg(feature = "async")] pub fn clear_is_tx_done() { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; @@ -2312,7 +2306,6 @@ mod private { .bit_is_set() } - #[cfg(feature = "async")] pub fn listen_tx_done() { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; @@ -2320,7 +2313,6 @@ mod private { reg_block.int_ena().modify(|_, w| w.tx_eof().set_bit()); } - #[cfg(feature = "async")] pub fn unlisten_tx_done() { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; @@ -2328,7 +2320,6 @@ mod private { reg_block.int_ena().modify(|_, w| w.tx_eof().clear_bit()); } - #[cfg(feature = "async")] pub fn is_listening_tx_done() -> bool { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; @@ -2336,7 +2327,6 @@ mod private { reg_block.int_ena().read().tx_eof().bit() } - #[cfg(feature = "async")] pub fn is_tx_done_set() -> bool { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; @@ -2344,7 +2334,6 @@ mod private { reg_block.int_raw().read().tx_eof().bit() } - #[cfg(feature = "async")] pub fn clear_is_tx_done() { let reg_block: crate::peripherals::PARL_IO = unsafe { crate::peripherals::PARL_IO::steal() }; diff --git a/esp-hal/src/rmt.rs b/esp-hal/src/rmt.rs index a2efc8eb87a..a858b3d02c5 100644 --- a/esp-hal/src/rmt.rs +++ b/esp-hal/src/rmt.rs @@ -208,7 +208,6 @@ pub struct RxChannelConfig { pub use impl_for_chip::{ChannelCreator, Rmt}; -#[cfg(feature = "async")] use self::asynch::{RxChannelAsync, TxChannelAsync}; impl<'d, M> Rmt<'d, M> @@ -288,7 +287,6 @@ impl<'d> InterruptConfigurable for Rmt<'d, crate::Blocking> { } } -#[cfg(feature = "async")] impl<'d> Rmt<'d, crate::Async> { /// Create a new RMT instance pub fn new_async( @@ -334,7 +332,6 @@ where } /// Creates a TX channel in async mode -#[cfg(feature = "async")] pub trait TxChannelCreatorAsync<'d, T, P> where P: OutputPin, @@ -412,7 +409,6 @@ where } /// Creates a RX channel in async mode -#[cfg(feature = "async")] pub trait RxChannelCreatorAsync<'d, T, P> where P: InputPin, @@ -601,7 +597,6 @@ macro_rules! impl_tx_channel_creator { impl $crate::rmt::TxChannel for $crate::rmt::Channel<$crate::Blocking, $channel> {} - #[cfg(feature = "async")] impl<'d, P> $crate::rmt::TxChannelCreatorAsync<'d, $crate::rmt::Channel<$crate::Async, $channel>, P> for ChannelCreator<$crate::Async, $channel> where @@ -609,7 +604,6 @@ macro_rules! impl_tx_channel_creator { { } - #[cfg(feature = "async")] impl $crate::rmt::asynch::TxChannelAsync for $crate::rmt::Channel<$crate::Async, $channel> {} }; } @@ -625,7 +619,6 @@ macro_rules! impl_rx_channel_creator { impl $crate::rmt::RxChannel for $crate::rmt::Channel<$crate::Blocking, $channel> {} - #[cfg(feature = "async")] impl<'d, P> $crate::rmt::RxChannelCreatorAsync<'d, $crate::rmt::Channel<$crate::Async, $channel>, P> for ChannelCreator<$crate::Async, $channel> where @@ -633,7 +626,6 @@ macro_rules! impl_rx_channel_creator { { } - #[cfg(feature = "async")] impl $crate::rmt::asynch::RxChannelAsync for $crate::rmt::Channel<$crate::Async, $channel> {} }; } @@ -1132,7 +1124,6 @@ pub trait RxChannel: private::RxChannelInternal { } /// Async functionality -#[cfg(feature = "async")] pub mod asynch { use core::{ pin::Pin, diff --git a/esp-hal/src/rng.rs b/esp-hal/src/rng.rs index 5ec8157b0a8..903e5dac177 100644 --- a/esp-hal/src/rng.rs +++ b/esp-hal/src/rng.rs @@ -93,7 +93,6 @@ impl Rng { } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::blocking::rng::Read for Rng { type Error = core::convert::Infallible; @@ -219,7 +218,6 @@ impl<'d> Drop for Trng<'d> { } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::blocking::rng::Read for Trng<'_> { type Error = core::convert::Infallible; /// Fills the provided buffer with random bytes. diff --git a/esp-hal/src/rsa/mod.rs b/esp-hal/src/rsa/mod.rs index 8bf11d0eafa..fdae81078d2 100644 --- a/esp-hal/src/rsa/mod.rs +++ b/esp-hal/src/rsa/mod.rs @@ -64,7 +64,6 @@ impl<'d> InterruptConfigurable for Rsa<'d, crate::Blocking> { } } -#[cfg(feature = "async")] impl<'d> Rsa<'d, crate::Async> { /// Create a new instance in [crate::Blocking] mode. pub fn new_async(rsa: impl Peripheral

+ 'd) -> Self { @@ -365,7 +364,6 @@ where } /// Async functionality -#[cfg(feature = "async")] pub(crate) mod asynch { use core::task::Poll; diff --git a/esp-hal/src/rtc_cntl/mod.rs b/esp-hal/src/rtc_cntl/mod.rs index c379228c923..b9f40129602 100644 --- a/esp-hal/src/rtc_cntl/mod.rs +++ b/esp-hal/src/rtc_cntl/mod.rs @@ -854,14 +854,12 @@ impl Rwdt { } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::watchdog::WatchdogDisable for Rwdt { fn disable(&mut self) { self.disable(); } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::watchdog::WatchdogEnable for Rwdt { type Time = MicrosDurationU64; @@ -873,7 +871,6 @@ impl embedded_hal_02::watchdog::WatchdogEnable for Rwdt { } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::watchdog::Watchdog for Rwdt { fn feed(&mut self) { self.feed(); @@ -935,10 +932,7 @@ impl Default for Swd { } } -#[cfg(all( - any(esp32c2, esp32c3, esp32c6, esp32h2, esp32s3), - feature = "embedded-hal-02" -))] +#[cfg(any(esp32c2, esp32c3, esp32c6, esp32h2, esp32s3))] impl embedded_hal_02::watchdog::WatchdogDisable for Swd { fn disable(&mut self) { self.disable(); diff --git a/esp-hal/src/spi/master.rs b/esp-hal/src/spi/master.rs index 4f81c6910ee..c6a986928a9 100644 --- a/esp-hal/src/spi/master.rs +++ b/esp-hal/src/spi/master.rs @@ -16,9 +16,8 @@ //! //! - Use the [`FullDuplex`](embedded_hal_02::spi::FullDuplex) trait to //! read/write single bytes at a time, -//! - Use the [`SpiBus`](embedded_hal::spi::SpiBus) trait (requires the -//! "embedded-hal" feature) and its associated functions to initiate -//! transactions with simultaneous reads and writes, or +//! - Use the [`SpiBus`](embedded_hal::spi::SpiBus) trait and its associated +//! functions to initiate transactions with simultaneous reads and writes, or //! - Use the `ExclusiveDevice` struct from [`embedded-hal-bus`] or `SpiDevice` //! from [`embassy-embedded-hal`]. //! @@ -900,7 +899,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::spi::FullDuplex for Spi<'_, T, FullDuplexMode> where T: Instance, @@ -916,7 +914,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::blocking::spi::Transfer for Spi<'_, T, FullDuplexMode> where T: Instance, @@ -928,7 +925,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::blocking::spi::Write for Spi<'_, T, FullDuplexMode> where T: Instance, @@ -948,12 +944,11 @@ mod dma { }; use super::*; - #[cfg(feature = "async")] - use crate::dma::asynch::{DmaRxFuture, DmaTxFuture}; #[cfg(spi3)] use crate::dma::Spi3Peripheral; use crate::{ dma::{ + asynch::{DmaRxFuture, DmaTxFuture}, Channel, DmaChannel, DmaRxBuf, @@ -1237,7 +1232,6 @@ mod dma { } } - #[cfg(feature = "async")] impl<'d, T, C, D, Buf> SpiDmaTransfer<'d, T, C, D, crate::Async, Buf> where T: Instance, @@ -1899,7 +1893,6 @@ mod dma { } } - #[cfg(feature = "embedded-hal-02")] impl<'d, T, C> embedded_hal_02::blocking::spi::Transfer for SpiDmaBus<'d, T, C, FullDuplexMode, crate::Blocking> where @@ -1915,7 +1908,6 @@ mod dma { } } - #[cfg(feature = "embedded-hal-02")] impl<'d, T, C> embedded_hal_02::blocking::spi::Write for SpiDmaBus<'d, T, C, FullDuplexMode, crate::Blocking> where @@ -1932,7 +1924,6 @@ mod dma { } /// Async functionality - #[cfg(feature = "async")] mod asynch { use core::{cmp::min, mem::take}; @@ -2163,7 +2154,6 @@ mod dma { } } - #[cfg(feature = "embedded-hal")] mod ehal1 { use embedded_hal::spi::{ErrorType, SpiBus}; @@ -2210,7 +2200,6 @@ mod dma { } } -#[cfg(feature = "embedded-hal")] mod ehal1 { use embedded_hal::spi::SpiBus; use embedded_hal_nb::spi::FullDuplex; diff --git a/esp-hal/src/spi/mod.rs b/esp-hal/src/spi/mod.rs index 3c73581c159..363bb7c09c3 100644 --- a/esp-hal/src/spi/mod.rs +++ b/esp-hal/src/spi/mod.rs @@ -39,7 +39,6 @@ impl From for Error { } } -#[cfg(feature = "embedded-hal")] impl embedded_hal::spi::Error for Error { fn kind(&self) -> embedded_hal::spi::ErrorKind { embedded_hal::spi::ErrorKind::Other diff --git a/esp-hal/src/timer/mod.rs b/esp-hal/src/timer/mod.rs index 2e2552684a5..90f6c5fd234 100644 --- a/esp-hal/src/timer/mod.rs +++ b/esp-hal/src/timer/mod.rs @@ -212,7 +212,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl<'d, T, UXX> embedded_hal_02::blocking::delay::DelayMs for OneShotTimer<'d, T> where T: Timer, @@ -223,7 +222,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl<'d, T, UXX> embedded_hal_02::blocking::delay::DelayUs for OneShotTimer<'d, T> where T: Timer, @@ -234,7 +232,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl<'d, T> embedded_hal::delay::DelayNs for OneShotTimer<'d, T> where T: Timer, @@ -329,7 +326,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl<'d, T> embedded_hal_02::timer::CountDown for PeriodicTimer<'d, T> where T: Timer, @@ -348,7 +344,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl<'d, T> embedded_hal_02::timer::Cancel for PeriodicTimer<'d, T> where T: Timer, @@ -360,7 +355,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl<'d, T> embedded_hal_02::timer::Periodic for PeriodicTimer<'d, T> where T: Timer {} /// A type-erased timer diff --git a/esp-hal/src/timer/systimer.rs b/esp-hal/src/timer/systimer.rs index 086d2c215ed..9f06162c626 100644 --- a/esp-hal/src/timer/systimer.rs +++ b/esp-hal/src/timer/systimer.rs @@ -1013,7 +1013,6 @@ static CONF_LOCK: LockState = LockState::new(); static INT_ENA_LOCK: LockState = LockState::new(); // Async functionality of the system timer. -#[cfg(feature = "async")] mod asynch { use core::{ pin::Pin, diff --git a/esp-hal/src/timer/timg.rs b/esp-hal/src/timer/timg.rs index 8e1dabc9a7c..8421fe2816c 100644 --- a/esp-hal/src/timer/timg.rs +++ b/esp-hal/src/timer/timg.rs @@ -820,7 +820,6 @@ where (1_000_000 * micros / period as u64) as u64 } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::timer::CountDown for Timer where T: Instance + super::Timer, @@ -845,7 +844,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::timer::Cancel for Timer where T: Instance + super::Timer, @@ -866,7 +864,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::timer::Periodic for Timer where T: Instance + super::Timer, @@ -1033,7 +1030,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::watchdog::WatchdogDisable for Wdt where TG: TimerGroupInstance, @@ -1044,7 +1040,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::watchdog::WatchdogEnable for Wdt where TG: TimerGroupInstance, @@ -1061,7 +1056,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::watchdog::Watchdog for Wdt where TG: TimerGroupInstance, diff --git a/esp-hal/src/touch.rs b/esp-hal/src/touch.rs index a6e59684e15..e81034c5e04 100644 --- a/esp-hal/src/touch.rs +++ b/esp-hal/src/touch.rs @@ -34,11 +34,12 @@ use crate::{ peripheral::{Peripheral, PeripheralRef}, peripherals::{RTC_CNTL, SENS, TOUCH}, private::{Internal, Sealed}, + rtc_cntl::Rtc, + Async, Blocking, + InterruptConfigurable, Mode, }; -#[cfg(feature = "async")] -use crate::{rtc_cntl::Rtc, Async, InterruptConfigurable}; /// A marker trait describing the mode the touch pad is set to. pub trait TouchMode: Sealed {} @@ -271,7 +272,6 @@ impl<'d> Touch<'d, Continous, Blocking> { } } } -#[cfg(feature = "async")] impl<'d> Touch<'d, Continous, Async> { /// Initializes the touch peripheral in continous async mode and returns /// this marker struct. @@ -294,6 +294,7 @@ impl<'d> Touch<'d, Continous, Async> { /// /// ```rust, no_run #[doc = crate::before_snippet!()] + /// # use esp_hal::rtc_cntl::Rtc; /// # use esp_hal::touch::{Touch, TouchConfig}; /// let mut rtc = Rtc::new(peripherals.LPWR); /// let touch = Touch::async_mode(peripherals.TOUCH, &mut rtc, None); @@ -493,7 +494,6 @@ fn internal_disable_interrupt(touch_nr: u8) { } } -#[cfg(feature = "async")] fn internal_disable_interrupts() { let sens = unsafe { &*SENS::ptr() }; sens.sar_touch_enable() @@ -523,7 +523,6 @@ fn internal_is_interrupt_set(touch_nr: u8) -> bool { internal_pins_touched() & (1 << touch_nr) != 0 } -#[cfg(feature = "async")] mod asynch { use core::{ sync::atomic::{AtomicU16, Ordering}, diff --git a/esp-hal/src/twai/mod.rs b/esp-hal/src/twai/mod.rs index 562b1b9b851..721a47fd225 100644 --- a/esp-hal/src/twai/mod.rs +++ b/esp-hal/src/twai/mod.rs @@ -201,7 +201,6 @@ impl core::fmt::Display for ErrorKind { } } -#[cfg(feature = "embedded-hal-02")] impl From for embedded_hal_02::can::ErrorKind { fn from(value: ErrorKind) -> Self { match value { @@ -216,14 +215,12 @@ impl From for embedded_hal_02::can::ErrorKind { } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::can::Error for ErrorKind { fn kind(&self) -> embedded_hal_02::can::ErrorKind { (*self).into() } } -#[cfg(feature = "embedded-hal")] impl From for embedded_can::ErrorKind { fn from(value: ErrorKind) -> Self { match value { @@ -238,7 +235,6 @@ impl From for embedded_can::ErrorKind { } } -#[cfg(feature = "embedded-hal")] impl embedded_can::Error for ErrorKind { fn kind(&self) -> embedded_can::ErrorKind { (*self).into() @@ -297,28 +293,24 @@ impl StandardId { } } -#[cfg(feature = "embedded-hal-02")] impl From for embedded_hal_02::can::StandardId { fn from(value: StandardId) -> Self { embedded_hal_02::can::StandardId::new(value.as_raw()).unwrap() } } -#[cfg(feature = "embedded-hal-02")] impl From for StandardId { fn from(value: embedded_hal_02::can::StandardId) -> Self { StandardId::new(value.as_raw()).unwrap() } } -#[cfg(feature = "embedded-hal")] impl From for embedded_can::StandardId { fn from(value: StandardId) -> Self { embedded_can::StandardId::new(value.as_raw()).unwrap() } } -#[cfg(feature = "embedded-hal")] impl From for StandardId { fn from(value: embedded_can::StandardId) -> Self { StandardId::new(value.as_raw()).unwrap() @@ -372,28 +364,24 @@ impl ExtendedId { } } -#[cfg(feature = "embedded-hal-02")] impl From for embedded_hal_02::can::ExtendedId { fn from(value: ExtendedId) -> Self { embedded_hal_02::can::ExtendedId::new(value.0).unwrap() } } -#[cfg(feature = "embedded-hal-02")] impl From for ExtendedId { fn from(value: embedded_hal_02::can::ExtendedId) -> Self { ExtendedId::new(value.as_raw()).unwrap() } } -#[cfg(feature = "embedded-hal")] impl From for embedded_can::ExtendedId { fn from(value: ExtendedId) -> Self { embedded_can::ExtendedId::new(value.0).unwrap() } } -#[cfg(feature = "embedded-hal")] impl From for ExtendedId { fn from(value: embedded_can::ExtendedId) -> Self { ExtendedId::new(value.as_raw()).unwrap() @@ -423,7 +411,6 @@ impl From for Id { } } -#[cfg(feature = "embedded-hal-02")] impl From for embedded_hal_02::can::Id { fn from(value: Id) -> Self { match value { @@ -433,7 +420,6 @@ impl From for embedded_hal_02::can::Id { } } -#[cfg(feature = "embedded-hal-02")] impl From for Id { fn from(value: embedded_hal_02::can::Id) -> Self { match value { @@ -443,7 +429,6 @@ impl From for Id { } } -#[cfg(feature = "embedded-hal")] impl From for embedded_can::Id { fn from(value: Id) -> Self { match value { @@ -453,7 +438,6 @@ impl From for embedded_can::Id { } } -#[cfg(feature = "embedded-hal")] impl From for Id { fn from(value: embedded_can::Id) -> Self { match value { @@ -556,7 +540,6 @@ impl EspTwaiFrame { } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::can::Frame for EspTwaiFrame { fn new(id: impl Into, data: &[u8]) -> Option { let id: embedded_hal_02::can::Id = id.into(); @@ -597,7 +580,6 @@ impl embedded_hal_02::can::Frame for EspTwaiFrame { } } -#[cfg(feature = "embedded-hal")] impl embedded_can::Frame for EspTwaiFrame { fn new(id: impl Into, data: &[u8]) -> Option { let id: embedded_can::Id = id.into(); @@ -961,7 +943,6 @@ where } } -#[cfg(feature = "async")] impl<'d, T> TwaiConfiguration<'d, T, crate::Async> where T: Instance, @@ -1190,7 +1171,6 @@ pub enum EspTwaiError { EmbeddedHAL(ErrorKind), } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::can::Error for EspTwaiError { fn kind(&self) -> embedded_hal_02::can::ErrorKind { match self { @@ -1200,7 +1180,6 @@ impl embedded_hal_02::can::Error for EspTwaiError { } } -#[cfg(feature = "embedded-hal")] impl embedded_can::Error for EspTwaiError { fn kind(&self) -> embedded_can::ErrorKind { match self { @@ -1242,7 +1221,6 @@ unsafe fn copy_to_data_register(dest: *mut u32, src: &[u8]) { } } -#[cfg(feature = "embedded-hal-02")] impl<'d, T, DM> embedded_hal_02::can::Can for Twai<'d, T, DM> where T: OperationInstance, @@ -1267,7 +1245,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl<'d, T, DM> embedded_can::nb::Can for Twai<'d, T, DM> where T: OperationInstance, @@ -1305,7 +1282,7 @@ pub trait Instance: crate::private::Sealed { const OUTPUT_SIGNAL: OutputSignal; /// The interrupt associated with this TWAI instance. const INTERRUPT: crate::peripherals::Interrupt; - #[cfg(feature = "async")] + /// Provides an asynchronous interrupt handler for TWAI instance. fn async_handler() -> InterruptHandler; @@ -1325,7 +1302,6 @@ pub trait Instance: crate::private::Sealed { /// An extension of the `Instance` trait that provides additional operations /// for managing and interacting with the TWAI peripheral. pub trait OperationInstance: Instance { - #[cfg(feature = "async")] /// Returns a reference to the asynchronous state for this TWAI instance. fn async_state() -> &'static asynch::TwaiAsyncState { &asynch::TWAI_STATE[Self::NUMBER] @@ -1502,7 +1478,6 @@ impl Instance for crate::peripherals::TWAI0 { const INTERRUPT: crate::peripherals::Interrupt = crate::peripherals::Interrupt::TWAI0; - #[cfg(feature = "async")] fn async_handler() -> InterruptHandler { asynch::twai0 } @@ -1550,7 +1525,6 @@ impl Instance for crate::peripherals::TWAI0 { const INTERRUPT: crate::peripherals::Interrupt = crate::peripherals::Interrupt::TWAI0; - #[cfg(feature = "async")] fn async_handler() -> InterruptHandler { asynch::twai0 } @@ -1598,7 +1572,6 @@ impl Instance for crate::peripherals::TWAI1 { const INTERRUPT: crate::peripherals::Interrupt = crate::peripherals::Interrupt::TWAI1; - #[cfg(feature = "async")] fn async_handler() -> InterruptHandler { asynch::twai1 } @@ -1636,7 +1609,6 @@ impl Instance for crate::peripherals::TWAI1 { #[cfg(esp32c6)] impl OperationInstance for crate::peripherals::TWAI1 {} -#[cfg(feature = "async")] mod asynch { use core::{future::poll_fn, task::Poll}; diff --git a/esp-hal/src/uart.rs b/esp-hal/src/uart.rs index 62e49a474e1..f1cb5425138 100644 --- a/esp-hal/src/uart.rs +++ b/esp-hal/src/uart.rs @@ -228,7 +228,6 @@ pub enum Error { InvalidArgument, /// The RX FIFO overflowed. - #[cfg(feature = "async")] RxFifoOvf, /// A glitch was detected on the RX line. @@ -236,14 +235,12 @@ pub enum Error { /// This error occurs when an unexpected or erroneous signal (glitch) is /// detected on the UART RX line, which could lead to incorrect data /// reception. - #[cfg(feature = "async")] RxGlitchDetected, /// A framing error was detected on the RX line. /// /// This error occurs when the received data does not conform to the /// expected UART frame format. - #[cfg(feature = "async")] RxFrameError, /// A parity error was detected on the RX line. @@ -251,18 +248,15 @@ pub enum Error { /// This error occurs when the parity bit in the received data does not /// match the expected parity configuration. /// with the `async` feature. - #[cfg(feature = "async")] RxParityError, } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Error for Error { fn kind(&self) -> embedded_hal_nb::serial::ErrorKind { embedded_hal_nb::serial::ErrorKind::Other } } -#[cfg(feature = "embedded-io")] impl embedded_io::Error for Error { fn kind(&self) -> embedded_io::ErrorKind { embedded_io::ErrorKind::Other @@ -1662,7 +1656,6 @@ impl_instance!(UART1, 1, U1TXD, U1RXD, U1CTS, U1RTS, Uart1); #[cfg(uart2)] impl_instance!(UART2, 2, U2TXD, U2RXD, U2CTS, U2RTS, Uart2); -#[cfg(feature = "ufmt")] impl ufmt_write::uWrite for Uart<'_, T, M> where T: Instance, @@ -1681,7 +1674,6 @@ where } } -#[cfg(feature = "ufmt")] impl ufmt_write::uWrite for UartTx<'_, T, M> where T: Instance, @@ -1720,7 +1712,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::serial::Write for Uart<'_, T, M> where T: Instance, @@ -1737,7 +1728,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::serial::Write for UartTx<'_, T, M> where T: Instance, @@ -1754,7 +1744,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::serial::Read for Uart<'_, T, M> where T: Instance, @@ -1767,7 +1756,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::serial::Read for UartRx<'_, T, M> where T: Instance, @@ -1780,22 +1768,18 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::ErrorType for Uart<'_, T, M> { type Error = Error; } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::ErrorType for UartTx<'_, T, M> { type Error = Error; } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::ErrorType for UartRx<'_, T, M> { type Error = Error; } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Read for Uart<'_, T, M> where T: Instance, @@ -1806,7 +1790,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Read for UartRx<'_, T, M> where T: Instance, @@ -1817,7 +1800,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Write for Uart<'_, T, M> where T: Instance, @@ -1832,7 +1814,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Write for UartTx<'_, T, M> where T: Instance, @@ -1847,22 +1828,18 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::ErrorType for Uart<'_, T, M> { type Error = Error; } -#[cfg(feature = "embedded-io")] impl embedded_io::ErrorType for UartTx<'_, T, M> { type Error = Error; } -#[cfg(feature = "embedded-io")] impl embedded_io::ErrorType for UartRx<'_, T, M> { type Error = Error; } -#[cfg(feature = "embedded-io")] impl embedded_io::Read for Uart<'_, T, M> where T: Instance, @@ -1873,7 +1850,6 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::Read for UartRx<'_, T, M> where T: Instance, @@ -1892,7 +1868,6 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::ReadReady for Uart<'_, T, M> where T: Instance, @@ -1903,7 +1878,6 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::ReadReady for UartRx<'_, T, M> where T: Instance, @@ -1914,7 +1888,6 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::Write for Uart<'_, T, M> where T: Instance, @@ -1929,7 +1902,6 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::Write for UartTx<'_, T, M> where T: Instance, @@ -1952,7 +1924,6 @@ where } } -#[cfg(feature = "async")] mod asynch { use core::task::Poll; diff --git a/esp-hal/src/usb_serial_jtag.rs b/esp-hal/src/usb_serial_jtag.rs index 5e70c0b1199..b09b50c03c1 100644 --- a/esp-hal/src/usb_serial_jtag.rs +++ b/esp-hal/src/usb_serial_jtag.rs @@ -425,7 +425,6 @@ where } } -#[cfg(feature = "ufmt")] impl ufmt_write::uWrite for UsbSerialJtag<'_, M> where M: Mode, @@ -443,7 +442,6 @@ where } } -#[cfg(feature = "ufmt")] impl ufmt_write::uWrite for UsbSerialJtagTx<'_, M> where M: Mode, @@ -465,7 +463,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::serial::Read for UsbSerialJtag<'_, M> where M: Mode, @@ -477,7 +474,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::serial::Read for UsbSerialJtagRx<'_, M> where M: Mode, @@ -489,7 +485,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::serial::Write for UsbSerialJtag<'_, M> where M: Mode, @@ -505,7 +500,6 @@ where } } -#[cfg(feature = "embedded-hal-02")] impl embedded_hal_02::serial::Write for UsbSerialJtagTx<'_, M> where M: Mode, @@ -521,7 +515,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::ErrorType for UsbSerialJtag<'_, M> where M: Mode, @@ -529,7 +522,6 @@ where type Error = Error; } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::ErrorType for UsbSerialJtagTx<'_, M> where M: Mode, @@ -537,7 +529,6 @@ where type Error = Error; } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::ErrorType for UsbSerialJtagRx<'_, M> where M: Mode, @@ -545,7 +536,6 @@ where type Error = Error; } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Read for UsbSerialJtag<'_, M> where M: Mode, @@ -555,7 +545,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Read for UsbSerialJtagRx<'_, M> where M: Mode, @@ -565,7 +554,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Write for UsbSerialJtag<'_, M> where M: Mode, @@ -579,7 +567,6 @@ where } } -#[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Write for UsbSerialJtagTx<'_, M> where M: Mode, @@ -593,7 +580,6 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::ErrorType for UsbSerialJtag<'_, M> where M: Mode, @@ -601,7 +587,6 @@ where type Error = Error; } -#[cfg(feature = "embedded-io")] impl embedded_io::ErrorType for UsbSerialJtagTx<'_, M> where M: Mode, @@ -609,7 +594,6 @@ where type Error = Error; } -#[cfg(feature = "embedded-io")] impl embedded_io::ErrorType for UsbSerialJtagRx<'_, M> where M: Mode, @@ -617,7 +601,6 @@ where type Error = Error; } -#[cfg(feature = "embedded-io")] impl embedded_io::Read for UsbSerialJtag<'_, M> where M: Mode, @@ -627,7 +610,6 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::Read for UsbSerialJtagRx<'_, M> where M: Mode, @@ -642,7 +624,6 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::Write for UsbSerialJtag<'_, M> where M: Mode, @@ -656,7 +637,6 @@ where } } -#[cfg(feature = "embedded-io")] impl embedded_io::Write for UsbSerialJtagTx<'_, M> where M: Mode, @@ -672,7 +652,6 @@ where } } -#[cfg(feature = "async")] mod asynch { use core::{marker::PhantomData, task::Poll}; diff --git a/esp-wifi/Cargo.toml b/esp-wifi/Cargo.toml index 3f1bb34d5ab..41f9968d07a 100644 --- a/esp-wifi/Cargo.toml +++ b/esp-wifi/Cargo.toml @@ -103,7 +103,6 @@ async = [ "dep:embassy-futures", "dep:embedded-io-async", "dep:esp-hal-embassy", - "esp-hal/async", ] embassy-net = ["dep:embassy-net-driver", "async"] diff --git a/examples/Cargo.toml b/examples/Cargo.toml index c05bee62d00..b2009458a54 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -19,7 +19,7 @@ embassy-net = { version = "0.4.0", features = [ "tcp", "udp", "dhcpv4", "medium- embassy-sync = "0.6.0" embassy-time = "0.3.1" embassy-time-driver = { version = "0.1.0", optional = true } -embassy-usb = { version = "0.2.0", default-features = false, optional = true } +embassy-usb = { version = "0.2.0", default-features = false } embedded-can = "0.4.1" embedded-graphics = "0.8.1" embedded-hal = "1.0.0" @@ -69,13 +69,7 @@ esp32s3 = ["esp-hal/esp32s3", "esp-backtrace/esp32s3", "esp-hal-embassy?/esp32s3 esp-wifi = ["dep:esp-wifi"] -async = ["esp-hal/async", "embassy-usb"] - -embedded-hal-02 = ["esp-hal/embedded-hal-02"] -embedded-hal = ["esp-hal/embedded-hal"] - -embassy = ["dep:esp-hal-embassy"] - +embassy = ["dep:esp-hal-embassy"] embassy-generic-timers = ["embassy-time/generic-queue-8"] opsram-2m = ["esp-hal/opsram-2m"] diff --git a/examples/src/bin/embassy_i2c.rs b/examples/src/bin/embassy_i2c.rs index 995c99942ad..b95a17b5b57 100644 --- a/examples/src/bin/embassy_i2c.rs +++ b/examples/src/bin/embassy_i2c.rs @@ -11,7 +11,7 @@ //! - SCL => GPIO5 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_i2c_bmp180_calibration_data.rs b/examples/src/bin/embassy_i2c_bmp180_calibration_data.rs index 2ba39581c2d..10c4279d873 100644 --- a/examples/src/bin/embassy_i2c_bmp180_calibration_data.rs +++ b/examples/src/bin/embassy_i2c_bmp180_calibration_data.rs @@ -12,7 +12,7 @@ //! //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_i2s_read.rs b/examples/src/bin/embassy_i2s_read.rs index 24324c64661..db5e9623dc3 100644 --- a/examples/src/bin/embassy_i2s_read.rs +++ b/examples/src/bin/embassy_i2s_read.rs @@ -12,7 +12,7 @@ //! - DIN => GPIO5 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_i2s_sound.rs b/examples/src/bin/embassy_i2s_sound.rs index 1a5a0a76b02..2781f787090 100644 --- a/examples/src/bin/embassy_i2s_sound.rs +++ b/examples/src/bin/embassy_i2s_sound.rs @@ -26,7 +26,7 @@ //! | XSMT | +3V3 | //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_parl_io_rx.rs b/examples/src/bin/embassy_parl_io_rx.rs index dae767bbd47..13bf5c4a69a 100644 --- a/examples/src/bin/embassy_parl_io_rx.rs +++ b/examples/src/bin/embassy_parl_io_rx.rs @@ -5,7 +5,7 @@ //! - Data pins => GPIO1, GPIO2, GPIO3, and GPIO4. //% CHIPS: esp32c6 esp32h2 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_parl_io_tx.rs b/examples/src/bin/embassy_parl_io_tx.rs index 7a90821e50f..5fed54f90c3 100644 --- a/examples/src/bin/embassy_parl_io_tx.rs +++ b/examples/src/bin/embassy_parl_io_tx.rs @@ -9,7 +9,7 @@ //! You can use a logic analyzer to see how the pins are used. //% CHIPS: esp32c6 esp32h2 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_rmt_rx.rs b/examples/src/bin/embassy_rmt_rx.rs index 794aeceedd9..86d299a9e35 100644 --- a/examples/src/bin/embassy_rmt_rx.rs +++ b/examples/src/bin/embassy_rmt_rx.rs @@ -4,7 +4,7 @@ //! - Connect GPIO4 and GPIO5 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_rmt_tx.rs b/examples/src/bin/embassy_rmt_tx.rs index c8cc3c83427..f446527b0ea 100644 --- a/examples/src/bin/embassy_rmt_tx.rs +++ b/examples/src/bin/embassy_rmt_tx.rs @@ -6,7 +6,7 @@ //! - generated pulses => GPIO4 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_serial.rs b/examples/src/bin/embassy_serial.rs index 541ea6c8e89..e2da6b3d377 100644 --- a/examples/src/bin/embassy_serial.rs +++ b/examples/src/bin/embassy_serial.rs @@ -4,7 +4,7 @@ //! writing to and reading from UART. //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_spi.rs b/examples/src/bin/embassy_spi.rs index a8f6ab68720..90500980d8f 100644 --- a/examples/src/bin/embassy_spi.rs +++ b/examples/src/bin/embassy_spi.rs @@ -13,7 +13,7 @@ //! CS => GPIO5 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_touch.rs b/examples/src/bin/embassy_touch.rs index e0f199442f9..d311aca68bc 100644 --- a/examples/src/bin/embassy_touch.rs +++ b/examples/src/bin/embassy_touch.rs @@ -7,7 +7,7 @@ //! pad on a PCB). //% CHIPS: esp32 -//% FEATURES: async embassy esp-hal-embassy/integrated-timers +//% FEATURES: embassy esp-hal-embassy/integrated-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_twai.rs b/examples/src/bin/embassy_twai.rs index 10ddc4e8df9..8655c936981 100644 --- a/examples/src/bin/embassy_twai.rs +++ b/examples/src/bin/embassy_twai.rs @@ -15,7 +15,7 @@ //! - RX => GPIO2 //% CHIPS: esp32c3 esp32c6 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_usb_serial.rs b/examples/src/bin/embassy_usb_serial.rs index f9acd516163..0c9ecd950bd 100644 --- a/examples/src/bin/embassy_usb_serial.rs +++ b/examples/src/bin/embassy_usb_serial.rs @@ -7,7 +7,7 @@ //! - DM => GPIO19 //% CHIPS: esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_usb_serial_jtag.rs b/examples/src/bin/embassy_usb_serial_jtag.rs index d72089fdfb5..7ca40e7a0dc 100644 --- a/examples/src/bin/embassy_usb_serial_jtag.rs +++ b/examples/src/bin/embassy_usb_serial_jtag.rs @@ -3,7 +3,7 @@ //! Most dev-kits use a USB-UART-bridge - in that case you won't see any output. //% CHIPS: esp32c3 esp32c6 esp32h2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/embassy_wait.rs b/examples/src/bin/embassy_wait.rs index 9b9d5854db7..e2ee6d4552f 100644 --- a/examples/src/bin/embassy_wait.rs +++ b/examples/src/bin/embassy_wait.rs @@ -3,7 +3,7 @@ //! This is an example of asynchronously `Wait`ing for a pin state (boot button) to change. //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-generic-timers +//% FEATURES: embassy embassy-generic-timers #![no_std] #![no_main] diff --git a/examples/src/bin/i2c_display.rs b/examples/src/bin/i2c_display.rs index a225d44b0f4..ef9b44ac439 100644 --- a/examples/src/bin/i2c_display.rs +++ b/examples/src/bin/i2c_display.rs @@ -8,7 +8,6 @@ //! - SCL => GPIO5 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: embedded-hal-02 #![no_std] #![no_main] diff --git a/examples/src/bin/wifi_embassy_access_point.rs b/examples/src/bin/wifi_embassy_access_point.rs index 22e65a8e5bc..e91754b591e 100644 --- a/examples/src/bin/wifi_embassy_access_point.rs +++ b/examples/src/bin/wifi_embassy_access_point.rs @@ -8,7 +8,7 @@ //! //! Because of the huge task-arena size configured this won't work on ESP32-S2 -//% FEATURES: async embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils +//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils //% CHIPS: esp32 esp32s3 esp32c2 esp32c3 esp32c6 #![no_std] diff --git a/examples/src/bin/wifi_embassy_access_point_with_sta.rs b/examples/src/bin/wifi_embassy_access_point_with_sta.rs index 42d2d2e43e9..3907ace1299 100644 --- a/examples/src/bin/wifi_embassy_access_point_with_sta.rs +++ b/examples/src/bin/wifi_embassy_access_point_with_sta.rs @@ -11,7 +11,7 @@ //! //! Because of the huge task-arena size configured this won't work on ESP32-S2 -//% FEATURES: async embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils +//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils //% CHIPS: esp32 esp32s3 esp32c2 esp32c3 esp32c6 #![no_std] diff --git a/examples/src/bin/wifi_embassy_bench.rs b/examples/src/bin/wifi_embassy_bench.rs index 5a53e8fd4f9..eb27084a943 100644 --- a/examples/src/bin/wifi_embassy_bench.rs +++ b/examples/src/bin/wifi_embassy_bench.rs @@ -10,7 +10,7 @@ //! Because of the huge task-arena size configured this won't work on ESP32-S2 and ESP32-C2 //! -//% FEATURES: async embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils +//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils //% CHIPS: esp32 esp32s3 esp32c3 esp32c6 #![no_std] diff --git a/examples/src/bin/wifi_embassy_ble.rs b/examples/src/bin/wifi_embassy_ble.rs index 282d6e6a17b..184e0f66641 100644 --- a/examples/src/bin/wifi_embassy_ble.rs +++ b/examples/src/bin/wifi_embassy_ble.rs @@ -4,7 +4,7 @@ //! - offers one service with three characteristics (one is read/write, one is write only, one is read/write/notify) //! - pressing the boot-button on a dev-board will send a notification if it is subscribed -//% FEATURES: async embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/ble +//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/ble //% CHIPS: esp32 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 #![no_std] diff --git a/examples/src/bin/wifi_embassy_dhcp.rs b/examples/src/bin/wifi_embassy_dhcp.rs index 96d17d926fb..cb3108b3e61 100644 --- a/examples/src/bin/wifi_embassy_dhcp.rs +++ b/examples/src/bin/wifi_embassy_dhcp.rs @@ -7,7 +7,7 @@ //! //! Because of the huge task-arena size configured this won't work on ESP32-S2 -//% FEATURES: async embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils +//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils //% CHIPS: esp32 esp32s3 esp32c2 esp32c3 esp32c6 #![no_std] diff --git a/examples/src/bin/wifi_embassy_esp_now.rs b/examples/src/bin/wifi_embassy_esp_now.rs index d14d95e0d95..39def6fd7ed 100644 --- a/examples/src/bin/wifi_embassy_esp_now.rs +++ b/examples/src/bin/wifi_embassy_esp_now.rs @@ -4,7 +4,7 @@ //! //! Because of the huge task-arena size configured this won't work on ESP32-S2 -//% FEATURES: async embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils esp-wifi/esp-now +//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils esp-wifi/esp-now //% CHIPS: esp32 esp32s3 esp32c2 esp32c3 esp32c6 #![no_std] diff --git a/examples/src/bin/wifi_embassy_esp_now_duplex.rs b/examples/src/bin/wifi_embassy_esp_now_duplex.rs index 773389ac155..946caac837a 100644 --- a/examples/src/bin/wifi_embassy_esp_now_duplex.rs +++ b/examples/src/bin/wifi_embassy_esp_now_duplex.rs @@ -4,7 +4,7 @@ //! //! Because of the huge task-arena size configured this won't work on ESP32-S2 -//% FEATURES: async embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils esp-wifi/esp-now +//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils esp-wifi/esp-now //% CHIPS: esp32 esp32s3 esp32c2 esp32c3 esp32c6 #![no_std] diff --git a/hil-test/Cargo.toml b/hil-test/Cargo.toml index e9427591d45..b8fc8051870 100644 --- a/hil-test/Cargo.toml +++ b/hil-test/Cargo.toml @@ -138,7 +138,7 @@ harness = false [[test]] name = "uart_async" harness = false -required-features = ["async", "embassy"] +required-features = ["embassy"] [[test]] name = "uart_tx_rx" @@ -151,17 +151,17 @@ harness = false [[test]] name = "embassy_timers_executors" harness = false -required-features = ["async", "embassy"] +required-features = ["embassy"] [[test]] name = "embassy_interrupt_executor" harness = false -required-features = ["async", "embassy"] +required-features = ["embassy"] [[test]] name = "embassy_interrupt_spi_dma" harness = false -required-features = ["async", "embassy"] +required-features = ["embassy"] [[test]] name = "twai" @@ -177,10 +177,10 @@ embassy-sync = "0.6.0" embassy-time = { version = "0.3.1" } embedded-hal = "1.0.0" embedded-hal-02 = { version = "0.2.7", package = "embedded-hal", features = ["unproven"] } -embedded-hal-async = { version = "1.0.0", optional = true } +embedded-hal-async = "1.0.0" embedded-hal-nb = { version = "1.0.0", optional = true } esp-backtrace = { path = "../esp-backtrace", default-features = false, features = ["exception-handler", "panic-handler", "defmt", "semihosting"] } -esp-hal = { path = "../esp-hal", features = ["defmt", "digest", "embedded-hal", "embedded-hal-02"], optional = true } +esp-hal = { path = "../esp-hal", features = ["defmt", "digest"], optional = true } esp-hal-embassy = { path = "../esp-hal-embassy", optional = true } portable-atomic = "1.6.0" static_cell = { version = "2.1.0", features = ["nightly"] } @@ -205,7 +205,7 @@ esp-build = { version = "0.1.0", path = "../esp-build" } esp-metadata = { version = "0.3.0", path = "../esp-metadata" } [features] -default = ["async", "embassy"] +default = ["embassy"] defmt = ["dep:defmt-rtt"] @@ -233,7 +233,6 @@ esp32s3 = [ "esp-hal-embassy/esp32s3", ] # Async & Embassy: -async = ["dep:embedded-hal-async", "esp-hal?/async"] embassy = [ "embedded-test/embassy", "embedded-test/external-executor", diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 21436a92b13..2ae6458f62a 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -572,7 +572,7 @@ fn lint_packages(workspace: &Path, args: LintPackagesArgs) -> Result<()> { &[ "-Zbuild-std=core", &format!("--target={}", chip.lp_target().unwrap()), - &format!("--features={chip},embedded-io,embedded-hal-02"), + &format!("--features={chip},embedded-io"), ], )?; }