From 6869eedc92f411761a91cd05aaf8d9655fc1269c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Tue, 7 Oct 2025 15:18:33 +0200 Subject: [PATCH] Touch up dependencies (#4280) * Remove esp-metadata dependency * Update dependencies * Remove litrs --- esp-alloc/Cargo.toml | 6 +- esp-backtrace/Cargo.toml | 6 +- esp-bootloader-esp-idf/Cargo.toml | 8 +- esp-config/Cargo.toml | 20 +- esp-config/src/bin/esp-config/tui.rs | 16 +- esp-hal-procmacros/Cargo.toml | 15 +- esp-hal-procmacros/src/lp_core.rs | 32 +- esp-hal/CHANGELOG.md | 1 + esp-hal/Cargo.toml | 57 ++-- esp-hal/src/soc/esp32/cpu_control.rs | 5 +- esp-hal/src/soc/esp32s3/cpu_control.rs | 5 +- esp-hal/src/uart/mod.rs | 245 ++++++++++++-- esp-hal/src/usb_serial_jtag.rs | 150 ++++++++- esp-lp-hal/Cargo.toml | 9 +- esp-lp-hal/src/uart.rs | 84 ++++- esp-metadata-generated/Cargo.toml | 3 - esp-phy/Cargo.toml | 4 +- esp-println/Cargo.toml | 8 +- esp-radio/CHANGELOG.md | 1 + esp-radio/Cargo.toml | 21 +- esp-radio/src/ble/btdm.rs | 2 +- esp-radio/src/ble/controller/mod.rs | 308 ++++++++++-------- esp-radio/src/ble/npl.rs | 4 +- esp-riscv-rt/Cargo.toml | 4 +- esp-rom-sys/Cargo.toml | 4 +- esp-rtos/Cargo.toml | 6 +- esp-storage/Cargo.toml | 12 +- esp-sync/Cargo.toml | 4 +- examples/async/embassy_multicore/Cargo.toml | 2 +- .../embassy_multicore_interrupt/Cargo.toml | 2 +- examples/async/embassy_rmt_rx/Cargo.toml | 2 +- examples/async/embassy_rmt_tx/Cargo.toml | 2 +- examples/async/embassy_serial/Cargo.toml | 6 +- examples/async/embassy_spi/Cargo.toml | 2 +- .../async/embassy_usb_serial_jtag/Cargo.toml | 4 +- examples/ble/bas_peripheral/Cargo.toml | 2 +- .../esp-now/embassy_esp_now_duplex/Cargo.toml | 2 +- .../ieee802154/ieee802154_sniffer/Cargo.toml | 2 +- examples/interrupt/gpio/Cargo.toml | 4 +- examples/ota/update/Cargo.toml | 2 +- examples/peripheral/debug_assist/Cargo.toml | 4 +- examples/peripheral/dma/mem2mem/Cargo.toml | 2 +- examples/peripheral/spi/slave_dma/Cargo.toml | 2 +- examples/peripheral/touch/Cargo.toml | 2 +- examples/wifi/sniffer/Cargo.toml | 2 +- hil-test/Cargo.toml | 14 +- qa-test/Cargo.toml | 4 +- xtensa-lx-rt/Cargo.toml | 2 +- xtensa-lx/Cargo.toml | 2 +- 49 files changed, 754 insertions(+), 352 deletions(-) diff --git a/esp-alloc/Cargo.toml b/esp-alloc/Cargo.toml index 08466f6e8..b808ff8c8 100644 --- a/esp-alloc/Cargo.toml +++ b/esp-alloc/Cargo.toml @@ -31,10 +31,10 @@ test = false [dependencies] allocator-api2 = { version = "0.3.0", default-features = false } defmt = { version = "1.0.1", optional = true } -cfg-if = "1.0.0" -enumset = "1.1.6" +cfg-if = "1" +enumset = "1" esp-sync = { version = "0.0.0", path = "../esp-sync" } -document-features = "0.2.11" +document-features = "0.2" linked_list_allocator = { version = "0.10.5", default-features = false, features = ["const_mut_refs"] } rlsf = { version = "0.2", features = ["unstable"] } diff --git a/esp-backtrace/Cargo.toml b/esp-backtrace/Cargo.toml index f7d5b32f4..c3acb6c1a 100644 --- a/esp-backtrace/Cargo.toml +++ b/esp-backtrace/Cargo.toml @@ -32,14 +32,14 @@ bench = false test = false [dependencies] -cfg-if = "1.0.0" +cfg-if = "1" defmt = { version = "1", optional = true } esp-config = { version = "0.5.0", path = "../esp-config" } esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated" } esp-println = { version = "0.15.0", optional = true, default-features = false, path = "../esp-println" } -heapless = "0.8" +heapless = "0.9" semihosting = { version = "0.1.20", optional = true } -document-features = "0.2.11" +document-features = "0.2" [target.'cfg(target_arch = "riscv32")'.dependencies] riscv = { version = "0.15.0" } diff --git a/esp-bootloader-esp-idf/Cargo.toml b/esp-bootloader-esp-idf/Cargo.toml index e1c86a7a7..c71327f98 100644 --- a/esp-bootloader-esp-idf/Cargo.toml +++ b/esp-bootloader-esp-idf/Cargo.toml @@ -29,14 +29,14 @@ bench = false test = true [dependencies] -cfg-if = "1.0.0" +cfg-if = "1" defmt = { version = "1.0.1", optional = true } -document-features = "0.2.11" +document-features = "0.2" esp-config = { version = "0.5.0", path = "../esp-config" } esp-rom-sys = { version = "0.1.1", path = "../esp-rom-sys", optional = true } embedded-storage = "0.3.1" -log-04 = { package = "log", version = "0.4.26", optional = true } -strum = { version = "0.27.1", default-features = false, features = ["derive"] } +log-04 = { package = "log", version = "0.4", optional = true } +strum = { version = "0.27", default-features = false, features = ["derive"] } crc = { version = "3.3.0", optional = true } md-5 = { version = "0.10.6", default-features = false, optional = true } diff --git a/esp-config/Cargo.toml b/esp-config/Cargo.toml index 407a598dc..508e5090c 100644 --- a/esp-config/Cargo.toml +++ b/esp-config/Cargo.toml @@ -27,24 +27,23 @@ name = "esp-config" required-features = ["tui"] [dependencies] -document-features = "0.2.11" +document-features = "0.2" # used by the `build` and `tui` feature -serde = { version = "1.0.197", default-features = false, features = ["derive"], optional = true } +serde = { version = "1.0", default-features = false, features = ["derive"], optional = true } serde_yaml = { version = "0.9", optional = true } somni-expr = { version = "0.2.0", optional = true } esp-metadata = { version = "0.8.0", path = "../esp-metadata", features = ["clap"], optional = true } esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated", features = ["build-script"], optional = true } # used by the `tui` feature -clap = { version = "4.5.32", features = ["derive"], optional = true } -crossterm = { version = "0.28.1", optional = true } -env_logger = { version = "0.11.7", optional = true } -log = { version = "0.4.26", optional = true } -ratatui = { version = "0.29.0", features = ["crossterm", "unstable"], optional = true } -toml_edit = { version = "0.22.26", optional = true } -tui-textarea = { version = "0.7.0", optional = true } -cargo_metadata = { version = "0.19.2", optional = true } +clap = { version = "4.5", features = ["derive"], optional = true } +env_logger = { version = "0.11", optional = true } +log = { version = "0.4", optional = true } +ratatui = { version = "0.29", features = ["crossterm", "unstable"], optional = true } +toml_edit = { version = "0.23", optional = true } +tui-textarea = { version = "0.7", optional = true } +cargo_metadata = { version = "0.23", optional = true } [dev-dependencies] temp-env = "0.3.6" @@ -57,7 +56,6 @@ build = ["dep:serde", "dep:serde_yaml", "dep:somni-expr", "dep:esp-metadata-gene ## The TUI tui = [ "dep:clap", - "dep:crossterm", "dep:env_logger", "dep:log", "dep:ratatui", diff --git a/esp-config/src/bin/esp-config/tui.rs b/esp-config/src/bin/esp-config/tui.rs index ad3a08cb1..ddc39d297 100644 --- a/esp-config/src/bin/esp-config/tui.rs +++ b/esp-config/src/bin/esp-config/tui.rs @@ -1,12 +1,16 @@ use std::{collections::HashMap, error::Error, io}; -use crossterm::{ - ExecutableCommand, - event::{self, Event, KeyCode, KeyEventKind}, - terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode}, -}; use esp_config::{DisplayHint, Stability, Validator, Value}; -use ratatui::{prelude::*, style::palette::tailwind, widgets::*}; +use ratatui::{ + crossterm::{ + ExecutableCommand, + event::{self, Event, KeyCode, KeyEventKind}, + terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode}, + }, + prelude::*, + style::palette::tailwind, + widgets::*, +}; use tui_textarea::{CursorMove, TextArea}; use crate::CrateConfig; diff --git a/esp-hal-procmacros/Cargo.toml b/esp-hal-procmacros/Cargo.toml index 23709dab9..f61afe518 100644 --- a/esp-hal-procmacros/Cargo.toml +++ b/esp-hal-procmacros/Cargo.toml @@ -24,14 +24,13 @@ features = ["has-ulp-core", "interrupt", "ram", "is-ulp-core"] proc-macro = true [dependencies] -document-features = "0.2.11" -litrs = "0.4.1" -object = { version = "0.36.7", default-features = false, features = ["read_core", "elf"], optional = true } -proc-macro-crate = "3.3.0" -proc-macro2 = "1.0.95" -quote = "1.0.40" -syn = { version = "2.0.100", features = ["extra-traits", "full"] } -termcolor = "1.4.1" +document-features = "0.2" +object = { version = "0.37", default-features = false, features = ["read_core", "elf"], optional = true } +proc-macro-crate = "3.4" +proc-macro2 = "1.0" +quote = "1.0" +syn = { version = "2.0", features = ["extra-traits", "full"] } +termcolor = "1.4" [features] ## Indicates the target device has RTC slow memory available. diff --git a/esp-hal-procmacros/src/lp_core.rs b/esp-hal-procmacros/src/lp_core.rs index 0a0129967..934880775 100644 --- a/esp-hal-procmacros/src/lp_core.rs +++ b/esp-hal-procmacros/src/lp_core.rs @@ -205,12 +205,11 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream { pub fn load_lp_code(input: TokenStream) -> TokenStream { use std::{fs, path::Path}; - use litrs::StringLit; use object::{File, Object, ObjectSection, ObjectSymbol, Section, SectionKind}; use parse::Error; use proc_macro::Span; use proc_macro_crate::{FoundCrate, crate_name}; - use syn::{Ident, parse}; + use syn::{Ident, LitStr, parse}; let hal_crate = if cfg!(any(feature = "is-lp-core", feature = "is-ulp-core")) { crate_name("esp-lp-hal") @@ -225,31 +224,14 @@ pub fn load_lp_code(input: TokenStream) -> TokenStream { quote!(crate) }; - let first_token = match input.into_iter().next() { - Some(token) => token, - None => { - return Error::new( - Span::call_site().into(), - "You need to give the path to an ELF file", - ) - .to_compile_error() - .into(); - } + let lit: LitStr = match syn::parse(input) { + Ok(lit) => lit, + Err(e) => return e.into_compile_error().into(), }; - let arg = match StringLit::try_from(&first_token) { - Ok(arg) => arg, - Err(_) => { - return Error::new( - Span::call_site().into(), - "You need to give the path to an ELF file", - ) - .to_compile_error() - .into(); - } - }; - let elf_file = arg.value(); - if !Path::new(elf_file).exists() { + let elf_file = lit.value(); + + if !Path::new(&elf_file).exists() { return Error::new(Span::call_site().into(), "File not found") .to_compile_error() .into(); diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index eceab102d..0d716b42c 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `rmt::Error` now implements `core::error::Error` (#4247) - `ram(reclaimed)` as an alias for `link_section = ".dram2_uninit"` (#4245) - `rmt::MAX_TX_LOOPCOUNT` and `rmt::MAX_RX_IDLE_THRESHOLD` constants have been added (#4276) +- Added support for `embedded-io 0.7` (#4280) ### Changed diff --git a/esp-hal/Cargo.toml b/esp-hal/Cargo.toml index d6d6a4e08..dc13250c3 100644 --- a/esp-hal/Cargo.toml +++ b/esp-hal/Cargo.toml @@ -45,22 +45,22 @@ bench = false test = false [dependencies] -bitflags = "2.9.0" -bytemuck = "1.22.0" -cfg-if = "1.0.0" -critical-section = { version = "1.2.0", features = ["restore-state-u32"], optional = true } +bitflags = "2.9" +bytemuck = "1.24" +cfg-if = "1" +critical-section = { version = "1", features = ["restore-state-u32"], optional = true } embedded-hal = "1.0.0" embedded-hal-async = "1.0.0" -enumset = "1.1.6" +enumset = "1.1" paste = "1.0.15" -portable-atomic = { version = "1.11.0", default-features = false } +portable-atomic = { version = "1.11", default-features = false } esp-rom-sys = { version = "0.1.1", path = "../esp-rom-sys" } # Unstable dependencies that are not (strictly) part of the public API -bitfield = "0.19.0" -delegate = "0.13.3" -document-features = "0.2.11" +bitfield = "0.19" +delegate = "0.13" +document-features = "0.2" embassy-futures = "0.1" embassy-sync = "0.7" fugit = "0.3.7" @@ -75,15 +75,15 @@ procmacros = { version = "0.19.0", package = "esp-hal-procmacros", # Dependencies that are optional because they are used by unstable drivers. # They are needed when using the `unstable` feature. digest = { version = "0.10.7", default-features = false, optional = true } -embassy-usb-driver = { version = "0.2.0", optional = true } -embassy-usb-synopsys-otg = { version = "0.3.0", optional = true } +embassy-usb-driver = { version = "0.2", optional = true } +embassy-usb-synopsys-otg = { version = "0.3", optional = true } embedded-can = { version = "0.4.1", optional = true } esp-synopsys-usb-otg = { version = "0.4.2", optional = true } -nb = { version = "1.1.0", optional = true } +nb = { version = "1.1", optional = true } # Logging interfaces, they are mutually exclusive so they need to be behind separate features. defmt = { version = "1.0.1", optional = true } -log-04 = { package = "log", version = "0.4.27", optional = true } +log-04 = { package = "log", version = "0.4", optional = true } # ESP32-only fallback SHA algorithms sha1 = { version = "0.10", default-features = false, optional = true } @@ -92,12 +92,14 @@ sha2 = { version = "0.10", default-features = false, optiona # Optional dependencies that enable ecosystem support. # We could support individually enabling them, but there is no big downside to just # enabling them all via the `unstable` feature. -embassy-embedded-hal = { version = "0.5.0", optional = true } -embedded-io = { version = "0.6.1", optional = true } -embedded-io-async = { version = "0.6.1", optional = true } -rand_core-06 = { package = "rand_core", version = "0.6.4", optional = true } -rand_core-09 = { package = "rand_core", version = "0.9.0", optional = true } -ufmt-write = { version = "0.1.0", optional = true } +embassy-embedded-hal = { version = "0.5", optional = true } +embedded-io-06 = { package = "embedded-io", version = "0.6", optional = true } +embedded-io-async-06 = { package = "embedded-io-async", version = "0.6", optional = true } +embedded-io-07 = { package = "embedded-io", version = "0.7", optional = true } +embedded-io-async-07 = { package = "embedded-io-async", version = "0.7", optional = true } +rand_core-06 = { package = "rand_core", version = "0.6", optional = true } +rand_core-09 = { package = "rand_core", version = "0.9", optional = true } +ufmt-write = { version = "0.1", optional = true } # IMPORTANT: # Each supported device MUST have its PAC included below along with a @@ -119,14 +121,12 @@ xtensa-lx = { version = "0.12.0", path = "../xtensa-lx" } xtensa-lx-rt = { version = "0.20.0", path = "../xtensa-lx-rt", optional = true } [build-dependencies] -cfg-if = "1.0.0" esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated", features = ["build-script"] } esp-config = { version = "0.5.0", path = "../esp-config", features = ["build"] } -serde = { version = "1.0.219", default-features = false, features = ["derive"] } [dev-dependencies] crypto-bigint = { version = "0.5.5", default-features = false } -jiff = { version = "0.2.10", default-features = false, features = ["static"] } +jiff = { version = "0.2", default-features = false, features = ["static"] } [features] default = ["rt", "exception-handler"] @@ -241,9 +241,10 @@ defmt = [ "dep:defmt", "embassy-futures/defmt", "embassy-sync/defmt", - "embedded-hal/defmt-03", - "embedded-io?/defmt-03", - "embedded-io-async?/defmt-03", + "embedded-io-06?/defmt-03", + "embedded-io-async-06?/defmt-03", + "embedded-io-07?/defmt", + "embedded-io-async-07?/defmt", "enumset/defmt", "esp32?/defmt", "esp32c2?/defmt", @@ -274,8 +275,10 @@ unstable = [ "dep:digest", "dep:embassy-embedded-hal", "dep:embedded-can", - "dep:embedded-io", - "dep:embedded-io-async", + "dep:embedded-io-06", + "dep:embedded-io-async-06", + "dep:embedded-io-07", + "dep:embedded-io-async-07", "dep:rand_core-06", "dep:rand_core-09", "dep:nb", diff --git a/esp-hal/src/soc/esp32/cpu_control.rs b/esp-hal/src/soc/esp32/cpu_control.rs index 65b939579..2bb780232 100644 --- a/esp-hal/src/soc/esp32/cpu_control.rs +++ b/esp-hal/src/soc/esp32/cpu_control.rs @@ -47,7 +47,10 @@ impl Stack { /// Construct a stack of length SIZE, uninitialized #[instability::unstable] pub const fn new() -> Stack { - ::core::assert!(SIZE % 16 == 0); // Make sure stack top is aligned, too. + const { + // Make sure stack top is aligned, too. + ::core::assert!(SIZE.is_multiple_of(16)); + } Stack { mem: MaybeUninit::uninit(), diff --git a/esp-hal/src/soc/esp32s3/cpu_control.rs b/esp-hal/src/soc/esp32s3/cpu_control.rs index c0dd08d09..02ab515a3 100644 --- a/esp-hal/src/soc/esp32s3/cpu_control.rs +++ b/esp-hal/src/soc/esp32s3/cpu_control.rs @@ -48,7 +48,10 @@ impl Stack { /// Construct a stack of length SIZE, uninitialized #[instability::unstable] pub const fn new() -> Stack { - ::core::assert!(SIZE % 16 == 0); // Make sure stack top is aligned, too. + const { + // Make sure stack top is aligned, too. + ::core::assert!(SIZE.is_multiple_of(16)); + } Stack { mem: MaybeUninit::uninit(), diff --git a/esp-hal/src/uart/mod.rs b/esp-hal/src/uart/mod.rs index f880de0cb..2b57b19bd 100644 --- a/esp-hal/src/uart/mod.rs +++ b/esp-hal/src/uart/mod.rs @@ -37,9 +37,9 @@ //! with this driver. //! //! [embedded-hal]: embedded_hal -//! [embedded-io]: embedded_io +//! [embedded-io]: embedded_io_07 //! [embedded-hal-async]: embedded_hal_async -//! [embedded-io-async]: embedded_io_async +//! [embedded-io-async]: embedded_io_async_07 /// UHCI wrapper around UART // TODO add support for PDMA and multiple UHCI for 32/S2 support @@ -49,8 +49,6 @@ pub mod uhci; use core::{marker::PhantomData, sync::atomic::Ordering, task::Poll}; -#[cfg(feature = "unstable")] -use embedded_io::ReadExactError; use enumset::{EnumSet, EnumSetType}; use portable_atomic::AtomicBool; @@ -122,9 +120,16 @@ impl core::fmt::Display for RxError { } #[instability::unstable] -impl embedded_io::Error for RxError { - fn kind(&self) -> embedded_io::ErrorKind { - embedded_io::ErrorKind::Other +impl embedded_io_06::Error for RxError { + fn kind(&self) -> embedded_io_06::ErrorKind { + embedded_io_06::ErrorKind::Other + } +} + +#[instability::unstable] +impl embedded_io_07::Error for RxError { + fn kind(&self) -> embedded_io_07::ErrorKind { + embedded_io_07::ErrorKind::Other } } @@ -143,9 +148,15 @@ impl core::fmt::Display for TxError { impl core::error::Error for TxError {} #[instability::unstable] -impl embedded_io::Error for TxError { - fn kind(&self) -> embedded_io::ErrorKind { - embedded_io::ErrorKind::Other +impl embedded_io_06::Error for TxError { + fn kind(&self) -> embedded_io_06::ErrorKind { + embedded_io_06::ErrorKind::Other + } +} +#[instability::unstable] +impl embedded_io_07::Error for TxError { + fn kind(&self) -> embedded_io_07::ErrorKind { + embedded_io_07::ErrorKind::Other } } @@ -2012,9 +2023,16 @@ impl core::fmt::Display for IoError { } #[instability::unstable] -impl embedded_io::Error for IoError { - fn kind(&self) -> embedded_io::ErrorKind { - embedded_io::ErrorKind::Other +impl embedded_io_06::Error for IoError { + fn kind(&self) -> embedded_io_06::ErrorKind { + embedded_io_06::ErrorKind::Other + } +} + +#[instability::unstable] +impl embedded_io_07::Error for IoError { + fn kind(&self) -> embedded_io_07::ErrorKind { + embedded_io_07::ErrorKind::Other } } @@ -2033,22 +2051,22 @@ impl From for IoError { } #[instability::unstable] -impl embedded_io::ErrorType for Uart<'_, Dm> { +impl embedded_io_06::ErrorType for Uart<'_, Dm> { type Error = IoError; } #[instability::unstable] -impl embedded_io::ErrorType for UartTx<'_, Dm> { +impl embedded_io_06::ErrorType for UartTx<'_, Dm> { type Error = TxError; } #[instability::unstable] -impl embedded_io::ErrorType for UartRx<'_, Dm> { +impl embedded_io_06::ErrorType for UartRx<'_, Dm> { type Error = RxError; } #[instability::unstable] -impl embedded_io::Read for Uart<'_, Dm> +impl embedded_io_06::Read for Uart<'_, Dm> where Dm: DriverMode, { @@ -2058,7 +2076,7 @@ where } #[instability::unstable] -impl embedded_io::Read for UartRx<'_, Dm> +impl embedded_io_06::Read for UartRx<'_, Dm> where Dm: DriverMode, { @@ -2068,7 +2086,7 @@ where } #[instability::unstable] -impl embedded_io::ReadReady for Uart<'_, Dm> +impl embedded_io_06::ReadReady for Uart<'_, Dm> where Dm: DriverMode, { @@ -2078,7 +2096,7 @@ where } #[instability::unstable] -impl embedded_io::ReadReady for UartRx<'_, Dm> +impl embedded_io_06::ReadReady for UartRx<'_, Dm> where Dm: DriverMode, { @@ -2088,7 +2106,7 @@ where } #[instability::unstable] -impl embedded_io::Write for Uart<'_, Dm> +impl embedded_io_06::Write for Uart<'_, Dm> where Dm: DriverMode, { @@ -2102,7 +2120,7 @@ where } #[instability::unstable] -impl embedded_io::Write for UartTx<'_, Dm> +impl embedded_io_06::Write for UartTx<'_, Dm> where Dm: DriverMode, { @@ -2116,7 +2134,7 @@ where } #[instability::unstable] -impl embedded_io::WriteReady for UartTx<'_, Dm> +impl embedded_io_06::WriteReady for UartTx<'_, Dm> where Dm: DriverMode, { @@ -2126,7 +2144,110 @@ where } #[instability::unstable] -impl embedded_io::WriteReady for Uart<'_, Dm> +impl embedded_io_06::WriteReady for Uart<'_, Dm> +where + Dm: DriverMode, +{ + fn write_ready(&mut self) -> Result { + Ok(self.tx.write_ready()) + } +} + +#[instability::unstable] +impl embedded_io_07::ErrorType for Uart<'_, Dm> { + type Error = IoError; +} + +#[instability::unstable] +impl embedded_io_07::ErrorType for UartTx<'_, Dm> { + type Error = TxError; +} + +#[instability::unstable] +impl embedded_io_07::ErrorType for UartRx<'_, Dm> { + type Error = RxError; +} + +#[instability::unstable] +impl embedded_io_07::Read for Uart<'_, Dm> +where + Dm: DriverMode, +{ + fn read(&mut self, buf: &mut [u8]) -> Result { + self.rx.read(buf).map_err(IoError::Rx) + } +} + +#[instability::unstable] +impl embedded_io_07::Read for UartRx<'_, Dm> +where + Dm: DriverMode, +{ + fn read(&mut self, buf: &mut [u8]) -> Result { + self.read(buf) + } +} + +#[instability::unstable] +impl embedded_io_07::ReadReady for Uart<'_, Dm> +where + Dm: DriverMode, +{ + fn read_ready(&mut self) -> Result { + Ok(self.rx.read_ready()) + } +} + +#[instability::unstable] +impl embedded_io_07::ReadReady for UartRx<'_, Dm> +where + Dm: DriverMode, +{ + fn read_ready(&mut self) -> Result { + Ok(self.read_ready()) + } +} + +#[instability::unstable] +impl embedded_io_07::Write for Uart<'_, Dm> +where + Dm: DriverMode, +{ + fn write(&mut self, buf: &[u8]) -> Result { + self.tx.write(buf).map_err(IoError::Tx) + } + + fn flush(&mut self) -> Result<(), Self::Error> { + self.tx.flush().map_err(IoError::Tx) + } +} + +#[instability::unstable] +impl embedded_io_07::Write for UartTx<'_, Dm> +where + Dm: DriverMode, +{ + fn write(&mut self, buf: &[u8]) -> Result { + self.write(buf) + } + + fn flush(&mut self) -> Result<(), Self::Error> { + self.flush() + } +} + +#[instability::unstable] +impl embedded_io_07::WriteReady for UartTx<'_, Dm> +where + Dm: DriverMode, +{ + fn write_ready(&mut self) -> Result { + Ok(self.write_ready()) + } +} + +#[instability::unstable] +impl embedded_io_07::WriteReady for Uart<'_, Dm> where Dm: DriverMode, { @@ -2272,33 +2393,39 @@ impl Drop for UartTxFuture { } #[instability::unstable] -impl embedded_io_async::Read for Uart<'_, Async> { +impl embedded_io_async_06::Read for Uart<'_, Async> { async fn read(&mut self, buf: &mut [u8]) -> Result { self.read_async(buf).await.map_err(IoError::Rx) } - async fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), ReadExactError> { + async fn read_exact( + &mut self, + buf: &mut [u8], + ) -> Result<(), embedded_io_06::ReadExactError> { self.read_exact_async(buf) .await - .map_err(|e| ReadExactError::Other(IoError::Rx(e))) + .map_err(|e| embedded_io_06::ReadExactError::Other(IoError::Rx(e))) } } #[instability::unstable] -impl embedded_io_async::Read for UartRx<'_, Async> { +impl embedded_io_async_06::Read for UartRx<'_, Async> { async fn read(&mut self, buf: &mut [u8]) -> Result { self.read_async(buf).await } - async fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), ReadExactError> { + async fn read_exact( + &mut self, + buf: &mut [u8], + ) -> Result<(), embedded_io_06::ReadExactError> { self.read_exact_async(buf) .await - .map_err(ReadExactError::Other) + .map_err(embedded_io_06::ReadExactError::Other) } } #[instability::unstable] -impl embedded_io_async::Write for Uart<'_, Async> { +impl embedded_io_async_06::Write for Uart<'_, Async> { async fn write(&mut self, buf: &[u8]) -> Result { self.write_async(buf).await.map_err(IoError::Tx) } @@ -2309,7 +2436,61 @@ impl embedded_io_async::Write for Uart<'_, Async> { } #[instability::unstable] -impl embedded_io_async::Write for UartTx<'_, Async> { +impl embedded_io_async_06::Write for UartTx<'_, Async> { + async fn write(&mut self, buf: &[u8]) -> Result { + self.write_async(buf).await + } + + async fn flush(&mut self) -> Result<(), Self::Error> { + self.flush_async().await + } +} + +#[instability::unstable] +impl embedded_io_async_07::Read for Uart<'_, Async> { + async fn read(&mut self, buf: &mut [u8]) -> Result { + self.read_async(buf).await.map_err(IoError::Rx) + } + + async fn read_exact( + &mut self, + buf: &mut [u8], + ) -> Result<(), embedded_io_07::ReadExactError> { + self.read_exact_async(buf) + .await + .map_err(|e| embedded_io_07::ReadExactError::Other(IoError::Rx(e))) + } +} + +#[instability::unstable] +impl embedded_io_async_07::Read for UartRx<'_, Async> { + async fn read(&mut self, buf: &mut [u8]) -> Result { + self.read_async(buf).await + } + + async fn read_exact( + &mut self, + buf: &mut [u8], + ) -> Result<(), embedded_io_07::ReadExactError> { + self.read_exact_async(buf) + .await + .map_err(embedded_io_07::ReadExactError::Other) + } +} + +#[instability::unstable] +impl embedded_io_async_07::Write for Uart<'_, Async> { + async fn write(&mut self, buf: &[u8]) -> Result { + self.write_async(buf).await.map_err(IoError::Tx) + } + + async fn flush(&mut self) -> Result<(), Self::Error> { + self.flush_async().await.map_err(IoError::Tx) + } +} + +#[instability::unstable] +impl embedded_io_async_07::Write for UartTx<'_, Async> { async fn write(&mut self, buf: &[u8]) -> Result { self.write_async(buf).await } diff --git a/esp-hal/src/usb_serial_jtag.rs b/esp-hal/src/usb_serial_jtag.rs index d685c9105..e83edfc02 100644 --- a/esp-hal/src/usb_serial_jtag.rs +++ b/esp-hal/src/usb_serial_jtag.rs @@ -537,7 +537,7 @@ where } #[instability::unstable] -impl embedded_io::ErrorType for UsbSerialJtag<'_, Dm> +impl embedded_io_06::ErrorType for UsbSerialJtag<'_, Dm> where Dm: DriverMode, { @@ -545,7 +545,7 @@ where } #[instability::unstable] -impl embedded_io::ErrorType for UsbSerialJtagTx<'_, Dm> +impl embedded_io_06::ErrorType for UsbSerialJtagTx<'_, Dm> where Dm: DriverMode, { @@ -553,7 +553,7 @@ where } #[instability::unstable] -impl embedded_io::ErrorType for UsbSerialJtagRx<'_, Dm> +impl embedded_io_06::ErrorType for UsbSerialJtagRx<'_, Dm> where Dm: DriverMode, { @@ -561,17 +561,17 @@ where } #[instability::unstable] -impl embedded_io::Read for UsbSerialJtag<'_, Dm> +impl embedded_io_06::Read for UsbSerialJtag<'_, Dm> where Dm: DriverMode, { fn read(&mut self, buf: &mut [u8]) -> Result { - embedded_io::Read::read(&mut self.rx, buf) + embedded_io_06::Read::read(&mut self.rx, buf) } } #[instability::unstable] -impl embedded_io::Read for UsbSerialJtagRx<'_, Dm> +impl embedded_io_06::Read for UsbSerialJtagRx<'_, Dm> where Dm: DriverMode, { @@ -586,21 +586,100 @@ where } #[instability::unstable] -impl embedded_io::Write for UsbSerialJtag<'_, Dm> +impl embedded_io_06::Write for UsbSerialJtag<'_, Dm> where Dm: DriverMode, { fn write(&mut self, buf: &[u8]) -> Result { - embedded_io::Write::write(&mut self.tx, buf) + embedded_io_06::Write::write(&mut self.tx, buf) } fn flush(&mut self) -> Result<(), Self::Error> { - embedded_io::Write::flush(&mut self.tx) + embedded_io_06::Write::flush(&mut self.tx) } } #[instability::unstable] -impl embedded_io::Write for UsbSerialJtagTx<'_, Dm> +impl embedded_io_06::Write for UsbSerialJtagTx<'_, Dm> +where + Dm: DriverMode, +{ + fn write(&mut self, buf: &[u8]) -> Result { + self.write(buf)?; + + Ok(buf.len()) + } + + fn flush(&mut self) -> Result<(), Self::Error> { + self.flush_tx() + } +} + +#[instability::unstable] +impl embedded_io_07::ErrorType for UsbSerialJtag<'_, Dm> +where + Dm: DriverMode, +{ + type Error = Error; +} + +#[instability::unstable] +impl embedded_io_07::ErrorType for UsbSerialJtagTx<'_, Dm> +where + Dm: DriverMode, +{ + type Error = Error; +} + +#[instability::unstable] +impl embedded_io_07::ErrorType for UsbSerialJtagRx<'_, Dm> +where + Dm: DriverMode, +{ + type Error = Error; +} + +#[instability::unstable] +impl embedded_io_07::Read for UsbSerialJtag<'_, Dm> +where + Dm: DriverMode, +{ + fn read(&mut self, buf: &mut [u8]) -> Result { + embedded_io_07::Read::read(&mut self.rx, buf) + } +} + +#[instability::unstable] +impl embedded_io_07::Read for UsbSerialJtagRx<'_, Dm> +where + Dm: DriverMode, +{ + fn read(&mut self, buf: &mut [u8]) -> Result { + loop { + let count = self.drain_rx_fifo(buf); + if count > 0 { + return Ok(count); + } + } + } +} + +#[instability::unstable] +impl embedded_io_07::Write for UsbSerialJtag<'_, Dm> +where + Dm: DriverMode, +{ + fn write(&mut self, buf: &[u8]) -> Result { + embedded_io_07::Write::write(&mut self.tx, buf) + } + + fn flush(&mut self) -> Result<(), Self::Error> { + embedded_io_07::Write::flush(&mut self.tx) + } +} + +#[instability::unstable] +impl embedded_io_07::Write for UsbSerialJtagTx<'_, Dm> where Dm: DriverMode, { @@ -771,18 +850,18 @@ impl UsbSerialJtagRx<'_, Async> { } #[instability::unstable] -impl embedded_io_async::Write for UsbSerialJtag<'_, Async> { +impl embedded_io_async_06::Write for UsbSerialJtag<'_, Async> { async fn write(&mut self, buf: &[u8]) -> Result { - embedded_io_async::Write::write(&mut self.tx, buf).await + embedded_io_async_06::Write::write(&mut self.tx, buf).await } async fn flush(&mut self) -> Result<(), Self::Error> { - embedded_io_async::Write::flush(&mut self.tx).await + embedded_io_async_06::Write::flush(&mut self.tx).await } } #[instability::unstable] -impl embedded_io_async::Write for UsbSerialJtagTx<'_, Async> { +impl embedded_io_async_06::Write for UsbSerialJtagTx<'_, Async> { async fn write(&mut self, buf: &[u8]) -> Result { self.write_async(buf).await?; @@ -795,14 +874,51 @@ impl embedded_io_async::Write for UsbSerialJtagTx<'_, Async> { } #[instability::unstable] -impl embedded_io_async::Read for UsbSerialJtag<'_, Async> { +impl embedded_io_async_06::Read for UsbSerialJtag<'_, Async> { async fn read(&mut self, buf: &mut [u8]) -> Result { - embedded_io_async::Read::read(&mut self.rx, buf).await + embedded_io_async_06::Read::read(&mut self.rx, buf).await } } #[instability::unstable] -impl embedded_io_async::Read for UsbSerialJtagRx<'_, Async> { +impl embedded_io_async_06::Read for UsbSerialJtagRx<'_, Async> { + async fn read(&mut self, buf: &mut [u8]) -> Result { + self.read_async(buf).await + } +} +#[instability::unstable] +impl embedded_io_async_07::Write for UsbSerialJtag<'_, Async> { + async fn write(&mut self, buf: &[u8]) -> Result { + embedded_io_async_07::Write::write(&mut self.tx, buf).await + } + + async fn flush(&mut self) -> Result<(), Self::Error> { + embedded_io_async_07::Write::flush(&mut self.tx).await + } +} + +#[instability::unstable] +impl embedded_io_async_07::Write for UsbSerialJtagTx<'_, Async> { + async fn write(&mut self, buf: &[u8]) -> Result { + self.write_async(buf).await?; + + Ok(buf.len()) + } + + async fn flush(&mut self) -> Result<(), Self::Error> { + self.flush_tx_async().await + } +} + +#[instability::unstable] +impl embedded_io_async_07::Read for UsbSerialJtag<'_, Async> { + async fn read(&mut self, buf: &mut [u8]) -> Result { + embedded_io_async_07::Read::read(&mut self.rx, buf).await + } +} + +#[instability::unstable] +impl embedded_io_async_07::Read for UsbSerialJtagRx<'_, Async> { async fn read(&mut self, buf: &mut [u8]) -> Result { self.read_async(buf).await } diff --git a/esp-lp-hal/Cargo.toml b/esp-lp-hal/Cargo.toml index 4d8ef0388..ef8233c18 100644 --- a/esp-lp-hal/Cargo.toml +++ b/esp-lp-hal/Cargo.toml @@ -35,11 +35,12 @@ bench = false test = false [dependencies] -cfg-if = "1.0.0" -document-features = "0.2.10" +cfg-if = "1" +document-features = "0.2" embedded-hal = { 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-06 = { package = "embedded-io", version = "0.6", optional = true } +embedded-io-07 = { package = "embedded-io", version = "0.7", optional = true } esp32c6-lp = { version = "0.3.0", features = ["critical-section"], optional = true } esp32s2-ulp = { version = "0.3.0", features = ["critical-section"], optional = true } esp32s3-ulp = { version = "0.3.0", features = ["critical-section"], optional = true } @@ -77,7 +78,7 @@ esp32s3 = ["dep:esp32s3-ulp", "esp-metadata-generated/esp32s3", "procmacros/is-u ## `embedded-hal-nb` for the relevant peripherals. embedded-hal = ["dep:embedded-hal", "dep:embedded-hal-nb"] ## Implement the traits defined in `embedded-io` for the relevant peripherals. -embedded-io = ["dep:embedded-io"] +embedded-io = ["dep:embedded-io-06", "dep:embedded-io-07"] [[example]] name = "blinky" diff --git a/esp-lp-hal/src/uart.rs b/esp-lp-hal/src/uart.rs index c0f1b9858..a30eaadd4 100644 --- a/esp-lp-hal/src/uart.rs +++ b/esp-lp-hal/src/uart.rs @@ -51,6 +51,16 @@ pub unsafe fn conjure() -> LpUart { #[derive(Debug)] pub enum Error {} +#[cfg(feature = "embedded-io")] +impl core::error::Error for Error {} + +#[cfg(feature = "embedded-io")] +impl core::fmt::Display for Error { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "UART error") + } +} + #[cfg(feature = "embedded-hal")] impl embedded_hal_nb::serial::Error for Error { fn kind(&self) -> embedded_hal_nb::serial::ErrorKind { @@ -59,9 +69,16 @@ impl embedded_hal_nb::serial::Error for Error { } #[cfg(feature = "embedded-io")] -impl embedded_io::Error for Error { - fn kind(&self) -> embedded_io::ErrorKind { - embedded_io::ErrorKind::Other +impl embedded_io_06::Error for Error { + fn kind(&self) -> embedded_io_06::ErrorKind { + embedded_io_06::ErrorKind::Other + } +} + +#[cfg(feature = "embedded-io")] +impl embedded_io_07::Error for Error { + fn kind(&self) -> embedded_io_07::ErrorKind { + embedded_io_07::ErrorKind::Other } } @@ -257,12 +274,12 @@ impl embedded_hal_nb::serial::Write for LpUart { } #[cfg(feature = "embedded-io")] -impl embedded_io::ErrorType for LpUart { +impl embedded_io_06::ErrorType for LpUart { type Error = Error; } #[cfg(feature = "embedded-io")] -impl embedded_io::Read for LpUart { +impl embedded_io_06::Read for LpUart { fn read(&mut self, buf: &mut [u8]) -> Result { if buf.is_empty() { return Ok(0); @@ -283,14 +300,67 @@ impl embedded_io::Read for LpUart { } #[cfg(feature = "embedded-io")] -impl embedded_io::ReadReady for LpUart { +impl embedded_io_06::ReadReady for LpUart { fn read_ready(&mut self) -> Result { Ok(self.rx_fifo_count() > 0) } } #[cfg(feature = "embedded-io")] -impl embedded_io::Write for LpUart { +impl embedded_io_06::Write for LpUart { + fn write(&mut self, buf: &[u8]) -> Result { + self.write_bytes(buf) + } + + fn flush(&mut self) -> Result<(), Self::Error> { + loop { + match self.flush_tx() { + Ok(_) => break, + Err(nb::Error::WouldBlock) => { /* Wait */ } + #[allow(unreachable_patterns)] + Err(nb::Error::Other(e)) => return Err(e), + } + } + + Ok(()) + } +} + +#[cfg(feature = "embedded-io")] +impl embedded_io_07::ErrorType for LpUart { + type Error = Error; +} + +#[cfg(feature = "embedded-io")] +impl embedded_io_07::Read for LpUart { + fn read(&mut self, buf: &mut [u8]) -> Result { + if buf.is_empty() { + return Ok(0); + } + + while self.rx_fifo_count() == 0 { + // Block until we have received at least one byte + } + + let mut count = 0; + while self.rx_fifo_count() > 0 && count < buf.len() { + buf[count] = self.uart.fifo().read().rxfifo_rd_byte().bits(); + count += 1; + } + + Ok(count) + } +} + +#[cfg(feature = "embedded-io")] +impl embedded_io_07::ReadReady for LpUart { + fn read_ready(&mut self) -> Result { + Ok(self.rx_fifo_count() > 0) + } +} + +#[cfg(feature = "embedded-io")] +impl embedded_io_07::Write for LpUart { fn write(&mut self, buf: &[u8]) -> Result { self.write_bytes(buf) } diff --git a/esp-metadata-generated/Cargo.toml b/esp-metadata-generated/Cargo.toml index c008bbfc9..3c56e3f0d 100644 --- a/esp-metadata-generated/Cargo.toml +++ b/esp-metadata-generated/Cargo.toml @@ -17,9 +17,6 @@ clippy-configs = [] # don't waste time on this [dependencies] -[build-dependencies] -esp-metadata = { version = "0.8.0", path = "../esp-metadata" } # TODO: remove - [features] build-script = [] _device-selected = [] diff --git a/esp-phy/Cargo.toml b/esp-phy/Cargo.toml index d224220e8..402570547 100644 --- a/esp-phy/Cargo.toml +++ b/esp-phy/Cargo.toml @@ -26,13 +26,13 @@ features = ["esp32c6"] bench = false [dependencies] +cfg-if = "1" + esp-hal = { version = "1.0.0-rc.0", path = "../esp-hal", default-features = false, features = ["requires-unstable"] } esp-wifi-sys = "0.8.1" esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated" } esp-sync = { version = "0.0.0", path = "../esp-sync" } -cfg-if = "1.0.1" - defmt = { version = "1.0.1", optional = true } log-04 = { version = "0.4.27", package = "log", optional = true } diff --git a/esp-println/Cargo.toml b/esp-println/Cargo.toml index 3bcaeb4e0..eee4a2959 100644 --- a/esp-println/Cargo.toml +++ b/esp-println/Cargo.toml @@ -36,21 +36,21 @@ bench = false test = false [dependencies] -document-features = "0.2.11" +document-features = "0.2" # Unstable dependencies that are not (strictly) part of the public API esp-sync = { version = "0.0.0", path = "../esp-sync", optional = true } # Optional dependencies -portable-atomic = { version = "1.11.0", optional = true, default-features = false } +portable-atomic = { version = "1.11", optional = true, default-features = false } # Logging interfaces, they are mutually exclusive so they need to be behind separate features. defmt = { version = "1.0.1", optional = true } -log-04 = { package = "log", version = "0.4.27", optional = true } +log-04 = { package = "log", version = "0.4", optional = true } [build-dependencies] esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated", features = ["build-script"] } -log-04 = { package = "log", version = "0.4.27" } +log-04 = { package = "log", version = "0.4" } [features] default = ["auto", "colors", "critical-section"] diff --git a/esp-radio/CHANGELOG.md b/esp-radio/CHANGELOG.md index cb6dedb35..c96e65a33 100644 --- a/esp-radio/CHANGELOG.md +++ b/esp-radio/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `dtim_period` parameter for `PowerSaveMode` (#4040) - `WifiConfig`, `CountryInfo` and `OperatingClass` (#4121) - Configuration options for `BleController` (#4223, #4254, #4259) +- BLE controller: Added support for `embedded-io 0.7` (#4280) ### Changed diff --git a/esp-radio/Cargo.toml b/esp-radio/Cargo.toml index e1e44e7c6..1945b6a9b 100644 --- a/esp-radio/Cargo.toml +++ b/esp-radio/Cargo.toml @@ -40,20 +40,18 @@ bench = false test = false [dependencies] +cfg-if = "1" esp-hal = { version = "1.0.0-rc.0", path = "../esp-hal", default-features = false, features = ["requires-unstable"] } -cfg-if = "1.0.0" -portable-atomic = { version = "1.11.0", default-features = false } -enumset = { version = "1.1.6", default-features = false, optional = true } +portable-atomic = { version = "1.11", default-features = false } +enumset = { version = "1.1", default-features = false, optional = true } # ⚠️ Unstable dependencies -embedded-io = { version = "0.6.1", default-features = false } -embedded-io-async = "0.6.1" esp-radio-rtos-driver = { version = "0.0.1", path = "../esp-radio-rtos-driver" } instability = "0.3.9" # Unstable dependencies that are not (strictly) part of the public API allocator-api2 = { version = "0.3.0", default-features = false, features = ["alloc"] } -document-features = "0.2.11" +document-features = "0.2" esp-alloc = { version = "0.8.0", path = "../esp-alloc", optional = true } esp-config = { version = "0.5.0", path = "../esp-config" } esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated" } @@ -70,6 +68,10 @@ ieee802154 = { version = "0.6.1", optional = true } heapless = "0.9" # Optional dependencies enabling ecosystem features +embedded-io-06 = { package = "embedded-io", version = "0.6", default-features = false, optional = true } +embedded-io-async-06 = { package = "embedded-io-async", version = "0.6", default-features = false, optional = true } +embedded-io-07 = { package = "embedded-io", version = "0.7", default-features = false, optional = true } +embedded-io-async-07 = { package = "embedded-io-async", version = "0.7", default-features = false, optional = true } serde = { version = "1.0.218", default-features = false, features = ["derive"], optional = true } smoltcp = { version = "0.12.0", default-features = false, features = [ "medium-ethernet", @@ -205,7 +207,12 @@ defmt = ["dep:defmt", "smoltcp?/defmt", "esp-hal/defmt", "bt-hci?/defmt", "esp-w #! ### Unstable APIs #! Unstable APIs are drivers and features that are not yet ready for general use. #! They may be incomplete, have bugs, or be subject to change without notice. -unstable = [] +unstable = [ + "dep:embedded-io-06", + "dep:embedded-io-async-06", + "dep:embedded-io-07", + "dep:embedded-io-async-07", +] ## Libraries that depend on `esp-radio` should enable this feature to indicate their use of unstable APIs. ## However, they must **not** enable the `unstable` feature themselves. diff --git a/esp-radio/src/ble/btdm.rs b/esp-radio/src/ble/btdm.rs index b9c646079..4415cb62d 100644 --- a/esp-radio/src/ble/btdm.rs +++ b/esp-radio/src/ble/btdm.rs @@ -83,7 +83,7 @@ extern "C" fn notify_host_recv(data: *mut u8, len: u16) -> i32 { super::dump_packet_info(data); - crate::ble::controller::asynch::hci_read_data_available(); + crate::ble::controller::hci_read_data_available(); 0 } diff --git a/esp-radio/src/ble/controller/mod.rs b/esp-radio/src/ble/controller/mod.rs index a74afece2..7206928a3 100644 --- a/esp-radio/src/ble/controller/mod.rs +++ b/esp-radio/src/ble/controller/mod.rs @@ -1,10 +1,19 @@ -use embedded_io::{Error, ErrorType, Read, Write}; +use core::task::Poll; + +use bt_hci::{ + ControllerToHostPacket, + FromHciBytes, + FromHciBytesError, + HostToControllerPacket, + WriteHci, + transport::{Transport, WithIndicator}, +}; +use esp_hal::asynch::AtomicWaker; use esp_phy::PhyInitGuard; -use super::{read_hci, read_next, send_hci}; use crate::{ Controller, - ble::{Config, InvalidConfigError}, + ble::{Config, InvalidConfigError, have_hci_read_data, read_hci, read_next, send_hci}, }; /// A blocking HCI connector @@ -38,6 +47,45 @@ impl<'d> BleConnector<'d> { pub fn next(&mut self, buf: &mut [u8]) -> Result { Ok(read_next(buf)) } + + /// Read from HCI. + #[instability::unstable] + pub fn read(&mut self, mut buf: &mut [u8]) -> Result { + let mut total = 0; + while !buf.is_empty() { + let len = read_hci(buf); + if len == 0 { + break; + } + + buf = &mut buf[len..]; + total += len; + } + Ok(total) + } + + /// Read from HCI. + #[instability::unstable] + pub async fn read_async(&mut self, buf: &mut [u8]) -> Result { + if buf.is_empty() { + return Ok(0); + } + + if !have_hci_read_data() { + HciReadyEventFuture.await; + } + + self.read(buf) + } + + /// Write to HCI. + #[instability::unstable] + pub fn write(&mut self, buf: &[u8]) -> Result { + for b in buf { + send_hci(&[*b]); + } + Ok(buf.len()) + } } #[derive(Debug)] @@ -48,9 +96,15 @@ pub enum BleConnectorError { Unknown, } -impl Error for BleConnectorError { - fn kind(&self) -> embedded_io::ErrorKind { - embedded_io::ErrorKind::Other +impl embedded_io_06::Error for BleConnectorError { + fn kind(&self) -> embedded_io_06::ErrorKind { + embedded_io_06::ErrorKind::Other + } +} + +impl embedded_io_07::Error for BleConnectorError { + fn kind(&self) -> embedded_io_07::ErrorKind { + embedded_io_07::ErrorKind::Other } } @@ -64,32 +118,19 @@ impl core::fmt::Display for BleConnectorError { } } -impl ErrorType for BleConnector<'_> { +impl embedded_io_06::ErrorType for BleConnector<'_> { type Error = BleConnectorError; } -impl Read for BleConnector<'_> { - fn read(&mut self, mut buf: &mut [u8]) -> Result { - let mut total = 0; - while !buf.is_empty() { - let len = read_hci(buf); - if len == 0 { - break; - } - - buf = &mut buf[len..]; - total += len; - } - Ok(total) +impl embedded_io_06::Read for BleConnector<'_> { + fn read(&mut self, buf: &mut [u8]) -> Result { + self.read(buf) } } -impl Write for BleConnector<'_> { +impl embedded_io_06::Write for BleConnector<'_> { fn write(&mut self, buf: &[u8]) -> Result { - for b in buf { - send_hci(&[*b]); - } - Ok(buf.len()) + self.write(buf) } fn flush(&mut self) -> Result<(), Self::Error> { @@ -98,132 +139,133 @@ impl Write for BleConnector<'_> { } } -/// Async Interface -pub(crate) mod asynch { - use core::task::Poll; +impl embedded_io_07::ErrorType for BleConnector<'_> { + type Error = BleConnectorError; +} - use bt_hci::{ - ControllerToHostPacket, - FromHciBytes, - FromHciBytesError, - HostToControllerPacket, - WriteHci, - transport::{Transport, WithIndicator}, - }; - use esp_hal::asynch::AtomicWaker; +impl embedded_io_07::Read for BleConnector<'_> { + fn read(&mut self, buf: &mut [u8]) -> Result { + self.read(buf) + } +} - use super::*; - use crate::ble::have_hci_read_data; - - static HCI_WAKER: AtomicWaker = AtomicWaker::new(); - - pub(crate) fn hci_read_data_available() { - HCI_WAKER.wake(); +impl embedded_io_07::Write for BleConnector<'_> { + fn write(&mut self, buf: &[u8]) -> Result { + self.write(buf) } - impl embedded_io_async::Read for BleConnector<'_> { - async fn read(&mut self, mut buf: &mut [u8]) -> Result { - if buf.is_empty() { - return Ok(0); - } + fn flush(&mut self) -> Result<(), Self::Error> { + // nothing to do + Ok(()) + } +} - let mut total = 0; - if !have_hci_read_data() { - HciReadyEventFuture.await; - } - while !buf.is_empty() { - let len = read_hci(buf); - if len == 0 { - break; - } +static HCI_WAKER: AtomicWaker = AtomicWaker::new(); - buf = &mut buf[len..]; - total += len; - } - Ok(total) - } +pub(crate) fn hci_read_data_available() { + HCI_WAKER.wake(); +} + +impl embedded_io_async_06::Read for BleConnector<'_> { + async fn read(&mut self, buf: &mut [u8]) -> Result { + self.read_async(buf).await + } +} + +impl embedded_io_async_06::Write for BleConnector<'_> { + async fn write(&mut self, buf: &[u8]) -> Result { + send_hci(buf); + Ok(buf.len()) } - impl embedded_io_async::Write for BleConnector<'_> { - async fn write(&mut self, buf: &[u8]) -> Result { - send_hci(buf); - Ok(buf.len()) - } + async fn flush(&mut self) -> Result<(), BleConnectorError> { + // nothing to do + Ok(()) + } +} - async fn flush(&mut self) -> Result<(), BleConnectorError> { - // nothing to do - Ok(()) - } +impl embedded_io_async_07::Read for BleConnector<'_> { + async fn read(&mut self, buf: &mut [u8]) -> Result { + self.read_async(buf).await + } +} + +impl embedded_io_async_07::Write for BleConnector<'_> { + async fn write(&mut self, buf: &[u8]) -> Result { + send_hci(buf); + Ok(buf.len()) } - impl From for BleConnectorError { - fn from(_e: FromHciBytesError) -> Self { - BleConnectorError::Unknown - } + async fn flush(&mut self) -> Result<(), BleConnectorError> { + // nothing to do + Ok(()) } +} - #[must_use = "futures do nothing unless you `.await` or poll them"] - pub(crate) struct HciReadyEventFuture; - - impl core::future::Future for HciReadyEventFuture { - type Output = (); - - fn poll( - self: core::pin::Pin<&mut Self>, - cx: &mut core::task::Context<'_>, - ) -> Poll { - HCI_WAKER.register(cx.waker()); - - if have_hci_read_data() { - Poll::Ready(()) - } else { - Poll::Pending - } - } +impl From for BleConnectorError { + fn from(_e: FromHciBytesError) -> Self { + BleConnectorError::Unknown } +} - fn parse_hci(data: &[u8]) -> Result>, BleConnectorError> { - match ControllerToHostPacket::from_hci_bytes_complete(data) { - Ok(p) => Ok(Some(p)), - Err(e) => { - warn!("[hci] error parsing packet: {:?}", e); - Err(BleConnectorError::Unknown) - } - } - } +#[must_use = "futures do nothing unless you `.await` or poll them"] +pub(crate) struct HciReadyEventFuture; - impl Transport for BleConnector<'_> { - /// Read a complete HCI packet into the rx buffer - async fn read<'a>( - &self, - rx: &'a mut [u8], - ) -> Result, Self::Error> { - loop { - if !have_hci_read_data() { - HciReadyEventFuture.await; - } +impl core::future::Future for HciReadyEventFuture { + type Output = (); - // Workaround for borrow checker. - // Safety: we only return a reference to x once, if parsing is successful. - let rx = - unsafe { &mut *core::ptr::slice_from_raw_parts_mut(rx.as_mut_ptr(), rx.len()) }; + fn poll( + self: core::pin::Pin<&mut Self>, + cx: &mut core::task::Context<'_>, + ) -> Poll { + HCI_WAKER.register(cx.waker()); - let len = crate::ble::read_next(rx); - if let Some(packet) = parse_hci(&rx[..len])? { - return Ok(packet); - } - } - } - - /// Write a complete HCI packet from the tx buffer - async fn write(&self, val: &T) -> Result<(), Self::Error> { - let mut buf: [u8; 259] = [0; 259]; - let w = WithIndicator::new(val); - let len = w.size(); - w.write_hci(&mut buf[..]) - .map_err(|_| BleConnectorError::Unknown)?; - send_hci(&buf[..len]); - Ok(()) + if have_hci_read_data() { + Poll::Ready(()) + } else { + Poll::Pending } } } + +fn parse_hci(data: &[u8]) -> Result>, BleConnectorError> { + match ControllerToHostPacket::from_hci_bytes_complete(data) { + Ok(p) => Ok(Some(p)), + Err(e) => { + warn!("[hci] error parsing packet: {:?}", e); + Err(BleConnectorError::Unknown) + } + } +} + +impl Transport for BleConnector<'_> { + /// Read a complete HCI packet into the rx buffer + async fn read<'a>(&self, rx: &'a mut [u8]) -> Result, Self::Error> { + loop { + if !have_hci_read_data() { + HciReadyEventFuture.await; + } + + // Workaround for borrow checker. + // Safety: we only return a reference to x once, if parsing is successful. + let rx = + unsafe { &mut *core::ptr::slice_from_raw_parts_mut(rx.as_mut_ptr(), rx.len()) }; + + let len = crate::ble::read_next(rx); + if let Some(packet) = parse_hci(&rx[..len])? { + return Ok(packet); + } + } + } + + /// Write a complete HCI packet from the tx buffer + async fn write(&self, val: &T) -> Result<(), Self::Error> { + let mut buf: [u8; 259] = [0; 259]; + let w = WithIndicator::new(val); + let len = w.size(); + w.write_hci(&mut buf[..]) + .map_err(|_| BleConnectorError::Unknown)?; + send_hci(&buf[..len]); + Ok(()) + } +} diff --git a/esp-radio/src/ble/npl.rs b/esp-radio/src/ble/npl.rs index 0aa9d143f..767855fcd 100644 --- a/esp-radio/src/ble/npl.rs +++ b/esp-radio/src/ble/npl.rs @@ -1377,7 +1377,7 @@ unsafe extern "C" fn ble_hs_hci_rx_evt(cmd: *const u8, arg: *const c_void) -> i3 r_ble_hci_trans_buf_free(cmd); } - crate::ble::controller::asynch::hci_read_data_available(); + crate::ble::controller::hci_read_data_available(); 0 } @@ -1406,7 +1406,7 @@ unsafe extern "C" fn ble_hs_rx_data(om: *const OsMbuf, arg: *const c_void) -> i3 r_os_mbuf_free_chain(om as *mut _); } - crate::ble::controller::asynch::hci_read_data_available(); + crate::ble::controller::hci_read_data_available(); 0 } diff --git a/esp-riscv-rt/Cargo.toml b/esp-riscv-rt/Cargo.toml index b820cac89..13c06e01b 100644 --- a/esp-riscv-rt/Cargo.toml +++ b/esp-riscv-rt/Cargo.toml @@ -27,8 +27,8 @@ bench = false test = false [dependencies] -document-features = "0.2.11" -defmt = {version = "1.0.1", optional = true} +document-features = "0.2" +defmt = { version = "1.0.1", optional = true } riscv = "0.15.0" # We use the `single-hart` feature since starting up harts != 0 is handled by the HAL, not the runtime. riscv-rt = {version = "0.16.0", features = ["pre-init", "no-exceptions", "no-interrupts", "single-hart", "v-trap", "pre-default-start-trap"]} diff --git a/esp-rom-sys/Cargo.toml b/esp-rom-sys/Cargo.toml index cc1497e32..d99d6bfc1 100644 --- a/esp-rom-sys/Cargo.toml +++ b/esp-rom-sys/Cargo.toml @@ -25,8 +25,8 @@ bench = false test = false [dependencies] -cfg-if = "1.0.1" -document-features = "0.2.11" +cfg-if = "1" +document-features = "0.2" [build-dependencies] esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated", features = ["build-script"] } diff --git a/esp-rtos/Cargo.toml b/esp-rtos/Cargo.toml index 435077473..c1ff3b0a1 100644 --- a/esp-rtos/Cargo.toml +++ b/esp-rtos/Cargo.toml @@ -41,14 +41,14 @@ rtos-trace = { version = "0.2.0", optional = true } # Unstable dependencies that are not (strictly) part of the public API allocator-api2 = { version = "0.3.0", default-features = false, features = ["alloc"], optional = true } -document-features = "0.2.11" +document-features = "0.2" embassy-sync = "0.7" esp-alloc = { version = "0.8.0", path = "../esp-alloc", optional = true } esp-config = { version = "0.5.0", path = "../esp-config" } esp-sync = { version = "0.0.0", path = "../esp-sync" } esp-radio-rtos-driver = { version = "0.0.1", path = "../esp-radio-rtos-driver", optional = true } macros = { version = "0.19.0", package = "esp-hal-procmacros", path = "../esp-hal-procmacros" } -portable-atomic = { version = "1.11.0", default-features = false } +portable-atomic = { version = "1.11", default-features = false } # Optional dependencies that enable ecosystem support. embassy-time-driver = { version = "0.2.1", features = [ "tick-hz-1_000_000" ], optional = true } @@ -57,7 +57,7 @@ embassy-time-queue-utils = { version = "0.3.0", optional = true } # Logging interfaces, they are mutually exclusive so they need to be behind separate features. defmt = { version = "1.0", optional = true } -log-04 = { package = "log", version = "0.4.27", optional = true } +log-04 = { package = "log", version = "0.4", optional = true } [build-dependencies] esp-config = { version = "0.5.0", path = "../esp-config", features = ["build"] } diff --git a/esp-storage/Cargo.toml b/esp-storage/Cargo.toml index 48f847e09..889fc3a07 100644 --- a/esp-storage/Cargo.toml +++ b/esp-storage/Cargo.toml @@ -37,13 +37,7 @@ esp-rom-sys = { version = "0.1.1", path = "../esp-rom-sys", optional = true defmt = { version = "1.0.1", optional = true } # Unstable dependencies that are not (strictly) part of the public API -document-features = "0.2.11" - -[target.'cfg(target_arch = "riscv32")'.dependencies] -riscv = { version = "0.14.0", optional = true} - -[target.'cfg(target_arch = "xtensa")'.dependencies] -xtensa-lx = { version = "0.12.0", path = "../xtensa-lx", optional = true } +document-features = "0.2" [build-dependencies] esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated", features = ["build-script"] } @@ -72,10 +66,10 @@ esp32c6 = ["esp-hal/esp32c6", "esp-hal/unstable", "esp-rom-sys/esp32c6", "esp- ## esp32h2 = ["esp-hal/esp32h2", "esp-hal/unstable", "esp-rom-sys/esp32h2", "esp-sync/esp32h2"] ## -esp32 = ["esp-hal/esp32", "esp-hal/unstable", "esp-rom-sys/esp32", "esp-sync/esp32", "xtensa-lx"] +esp32 = ["esp-hal/esp32", "esp-hal/unstable", "esp-rom-sys/esp32", "esp-sync/esp32"] ## esp32s2 = ["esp-hal/esp32s2", "esp-hal/unstable", "esp-rom-sys/esp32s2", "esp-sync/esp32s2"] ## -esp32s3 = ["esp-hal/esp32s3", "esp-hal/unstable", "esp-rom-sys/esp32s3", "esp-sync/esp32s3", "xtensa-lx"] +esp32s3 = ["esp-hal/esp32s3", "esp-hal/unstable", "esp-rom-sys/esp32s3", "esp-sync/esp32s3"] ## Used for testing on a host. emulation = [] diff --git a/esp-sync/Cargo.toml b/esp-sync/Cargo.toml index f6d5a7283..026ebcc75 100644 --- a/esp-sync/Cargo.toml +++ b/esp-sync/Cargo.toml @@ -30,10 +30,10 @@ defmt = { version = "1.0.1", optional = true } log-04 = { package = "log", version = "0.4", optional = true } [target.'cfg(target_arch = "riscv32")'.dependencies] -riscv = { version = "0.15.0" } +riscv = { version = "0.15" } [target.'cfg(target_arch = "xtensa")'.dependencies] -xtensa-lx = { version = "0.12.0", path = "../xtensa-lx" } +xtensa-lx = { version = "0.12", path = "../xtensa-lx" } [build-dependencies] esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated", features = ["build-script"] } diff --git a/examples/async/embassy_multicore/Cargo.toml b/examples/async/embassy_multicore/Cargo.toml index 8f5791b25..0f22973db 100644 --- a/examples/async/embassy_multicore/Cargo.toml +++ b/examples/async/embassy_multicore/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] embassy-executor = "0.9.0" -embassy-sync = "0.7.0" +embassy-sync = "0.7" embassy-time = "0.5.0" esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", diff --git a/examples/async/embassy_multicore_interrupt/Cargo.toml b/examples/async/embassy_multicore_interrupt/Cargo.toml index 175065034..d54b54915 100644 --- a/examples/async/embassy_multicore_interrupt/Cargo.toml +++ b/examples/async/embassy_multicore_interrupt/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] embassy-executor = "0.9.0" -embassy-sync = "0.7.0" +embassy-sync = "0.7" embassy-time = "0.5.0" esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", diff --git a/examples/async/embassy_rmt_rx/Cargo.toml b/examples/async/embassy_rmt_rx/Cargo.toml index 331c8203e..98e38f79c 100644 --- a/examples/async/embassy_rmt_rx/Cargo.toml +++ b/examples/async/embassy_rmt_rx/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.1" +cfg-if = "1" embassy-executor = "0.9.0" embassy-time = "0.5.0" esp-backtrace = { path = "../../../esp-backtrace", features = [ diff --git a/examples/async/embassy_rmt_tx/Cargo.toml b/examples/async/embassy_rmt_tx/Cargo.toml index 5ff676711..4aac913ba 100644 --- a/examples/async/embassy_rmt_tx/Cargo.toml +++ b/examples/async/embassy_rmt_tx/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.1" +cfg-if = "1" embassy-executor = "0.9.0" embassy-time = "0.5.0" esp-backtrace = { path = "../../../esp-backtrace", features = [ diff --git a/examples/async/embassy_serial/Cargo.toml b/examples/async/embassy_serial/Cargo.toml index 3e4b60ac3..67416fb09 100644 --- a/examples/async/embassy_serial/Cargo.toml +++ b/examples/async/embassy_serial/Cargo.toml @@ -5,10 +5,10 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.1" +cfg-if = "1" embassy-executor = "0.9.0" -embassy-sync = "0.7.0" -embedded-io-async = "0.6.1" +embassy-sync = "0.7" +embedded-io-async = "0.7.0" esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", "println", diff --git a/examples/async/embassy_spi/Cargo.toml b/examples/async/embassy_spi/Cargo.toml index 5efe945b2..7978a93e5 100644 --- a/examples/async/embassy_spi/Cargo.toml +++ b/examples/async/embassy_spi/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.0" +cfg-if = "1" embassy-executor = "0.9.0" embassy-time = "0.5.0" embedded-hal-async = "1.0.0" diff --git a/examples/async/embassy_usb_serial_jtag/Cargo.toml b/examples/async/embassy_usb_serial_jtag/Cargo.toml index bfa597f79..79260718b 100644 --- a/examples/async/embassy_usb_serial_jtag/Cargo.toml +++ b/examples/async/embassy_usb_serial_jtag/Cargo.toml @@ -6,8 +6,8 @@ publish = false [dependencies] embassy-executor = "0.9.0" -embassy-sync = "0.7.0" -embedded-io-async = "0.6.1" +embassy-sync = "0.7" +embedded-io-async = "0.7.0" esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", "println", diff --git a/examples/ble/bas_peripheral/Cargo.toml b/examples/ble/bas_peripheral/Cargo.toml index 10204768a..121a6523b 100644 --- a/examples/ble/bas_peripheral/Cargo.toml +++ b/examples/ble/bas_peripheral/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] embassy-executor = "0.9.0" embassy-futures = "0.1" -embassy-sync = "0.7.2" +embassy-sync = "0.7" embassy-time = "0.5.0" esp-alloc = { path = "../../../esp-alloc" } esp-backtrace = { path = "../../../esp-backtrace", features = [ diff --git a/examples/esp-now/embassy_esp_now_duplex/Cargo.toml b/examples/esp-now/embassy_esp_now_duplex/Cargo.toml index cc8efd028..4ff49fdbd 100644 --- a/examples/esp-now/embassy_esp_now_duplex/Cargo.toml +++ b/examples/esp-now/embassy_esp_now_duplex/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] embassy-executor = "0.9.0" -embassy-sync = "0.6.2" +embassy-sync = "0.7" embassy-time = "0.5.0" esp-alloc = { path = "../../../esp-alloc" } esp-backtrace = { path = "../../../esp-backtrace", features = [ diff --git a/examples/ieee802154/ieee802154_sniffer/Cargo.toml b/examples/ieee802154/ieee802154_sniffer/Cargo.toml index 6df1461a6..d03f4e9e0 100644 --- a/examples/ieee802154/ieee802154_sniffer/Cargo.toml +++ b/examples/ieee802154/ieee802154_sniffer/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.0" +cfg-if = "1" esp-alloc = { path = "../../../esp-alloc" } esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", diff --git a/examples/interrupt/gpio/Cargo.toml b/examples/interrupt/gpio/Cargo.toml index 263530077..78e1fefcb 100644 --- a/examples/interrupt/gpio/Cargo.toml +++ b/examples/interrupt/gpio/Cargo.toml @@ -5,8 +5,8 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.0" -critical-section = "1.1.3" +cfg-if = "1" +critical-section = "1" esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", "println", diff --git a/examples/ota/update/Cargo.toml b/examples/ota/update/Cargo.toml index 92817ea26..51c03c26b 100644 --- a/examples/ota/update/Cargo.toml +++ b/examples/ota/update/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.0" +cfg-if = "1" embedded-storage = "0.3.1" esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", diff --git a/examples/peripheral/debug_assist/Cargo.toml b/examples/peripheral/debug_assist/Cargo.toml index e120f0c7a..f9a0800b9 100644 --- a/examples/peripheral/debug_assist/Cargo.toml +++ b/examples/peripheral/debug_assist/Cargo.toml @@ -5,8 +5,8 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.0" -critical-section = "1.1.3" +cfg-if = "1" +critical-section = "1" esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", "println", diff --git a/examples/peripheral/dma/mem2mem/Cargo.toml b/examples/peripheral/dma/mem2mem/Cargo.toml index 72977d50f..19f7ac04a 100644 --- a/examples/peripheral/dma/mem2mem/Cargo.toml +++ b/examples/peripheral/dma/mem2mem/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.0" +cfg-if = "1" esp-backtrace = { path = "../../../../esp-backtrace", features = [ "panic-handler", "println", diff --git a/examples/peripheral/spi/slave_dma/Cargo.toml b/examples/peripheral/spi/slave_dma/Cargo.toml index ac34ad248..155a574fa 100644 --- a/examples/peripheral/spi/slave_dma/Cargo.toml +++ b/examples/peripheral/spi/slave_dma/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -cfg-if = "1.0.0" +cfg-if = "1" esp-backtrace = { path = "../../../../esp-backtrace", features = [ "panic-handler", "println", diff --git a/examples/peripheral/touch/Cargo.toml b/examples/peripheral/touch/Cargo.toml index 99e7e0ecb..0578d6028 100644 --- a/examples/peripheral/touch/Cargo.toml +++ b/examples/peripheral/touch/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -critical-section = "1.1.3" +critical-section = "1" esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", "println", diff --git a/examples/wifi/sniffer/Cargo.toml b/examples/wifi/sniffer/Cargo.toml index e6724ef25..4eabc945f 100644 --- a/examples/wifi/sniffer/Cargo.toml +++ b/examples/wifi/sniffer/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -critical-section = "1.1.3" +critical-section = "1" esp-alloc = { path = "../../../esp-alloc" } esp-backtrace = { path = "../../../esp-backtrace", features = [ "panic-handler", diff --git a/hil-test/Cargo.toml b/hil-test/Cargo.toml index 339cfd6c9..71c7eba2f 100644 --- a/hil-test/Cargo.toml +++ b/hil-test/Cargo.toml @@ -206,29 +206,29 @@ required-features = ["esp-radio", "esp-alloc"] [dependencies] allocator-api2 = { version = "0.3.0", default-features = false, features = ["alloc"] } -cfg-if = "1.0.0" -critical-section = "1.1.3" +cfg-if = "1" +critical-section = "1" defmt = "1.0.1" defmt-rtt = { version = "1.0.0", optional = true } embassy-executor = { version = "0.9.0", default-features = false } embassy-futures = "0.1" embedded-storage = "0.3.1" -embassy-sync = "0.6.0" +embassy-sync = "0.7.2" embassy-time = "0.5.0" embedded-hal = "1.0.0" -embedded-io = "0.6.1" -embedded-io-async = "0.6.1" +embedded-io = "0.7.1" +embedded-io-async = "0.7.0" embedded-can = "0.4.1" embedded-hal-async = "1.0.0" esp-alloc = { path = "../esp-alloc", optional = true } esp-bootloader-esp-idf = { path = "../esp-bootloader-esp-idf" } esp-hal = { path = "../esp-hal", features = ["defmt"] } -esp-rtos = { path = "../esp-rtos", features = ["defmt"], optional = true } +esp-rtos = { path = "../esp-rtos", features = ["defmt"], optional = true } esp-storage = { path = "../esp-storage", optional = true } esp-sync = { path = "../esp-sync" } esp-radio = { path = "../esp-radio", features = ["defmt"], optional = true } esp-radio-rtos-driver = { path = "../esp-radio-rtos-driver", optional = true } -portable-atomic = "1.11.0" +portable-atomic = "1.11" static_cell = { version = "2.1.0" } semihosting = { version = "0.1", features= ["stdio", "panic-handler"] } diff --git a/qa-test/Cargo.toml b/qa-test/Cargo.toml index 214ed73ab..d620bdc2a 100644 --- a/qa-test/Cargo.toml +++ b/qa-test/Cargo.toml @@ -7,12 +7,12 @@ publish = false [dependencies] blocking-network-stack = { git = "https://github.com/bjoernQ/blocking-network-stack.git", rev = "b3ecefc", optional = true } -cfg-if = "1.0.0" +cfg-if = "1" embassy-executor = "0.9.0" embassy-time = "0.5.0" embassy-futures = "0.1" embassy-net = { version = "0.7.0", features = [ "tcp", "udp", "dhcpv4", "medium-ethernet"] } -embassy-sync = "0.6.1" +embassy-sync = "0.7" embedded-graphics = "0.8.1" embedded-hal-async = "1.0.0" embedded-io = { version = "0.6.1", default-features = false } diff --git a/xtensa-lx-rt/Cargo.toml b/xtensa-lx-rt/Cargo.toml index c278f2e17..d0392646e 100644 --- a/xtensa-lx-rt/Cargo.toml +++ b/xtensa-lx-rt/Cargo.toml @@ -19,7 +19,7 @@ bench = false test = false [dependencies] -document-features = "0.2.11" +document-features = "0.2" defmt = {version = "1.0.1", optional = true} macros = { version = "0.4.0", package = "xtensa-lx-rt-proc-macros", path = "../xtensa-lx-rt-proc-macros" } xtensa-lx = { version = "0.12.0", path = "../xtensa-lx" } diff --git a/xtensa-lx/Cargo.toml b/xtensa-lx/Cargo.toml index eb04d1afd..4bc31a28f 100644 --- a/xtensa-lx/Cargo.toml +++ b/xtensa-lx/Cargo.toml @@ -18,6 +18,6 @@ bench = false test = false [dependencies] -critical-section = "1.2.0" +critical-section = "1" [features]