diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 710af7b8..143062fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,10 +68,10 @@ jobs: run: cd esp-wifi && cargo b${{ matrix.chip }} - name: build (common features) if: ${{ matrix.chip != 'esp32h2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --features=async,wifi,esp-now,embassy-net,log,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --features=async,wifi,esp-now,embassy-net,log,esp-hal/embassy-time-timg0 - name: build (common features + defmt) if: ${{ matrix.chip != 'esp32h2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --no-default-features --features=async,wifi,esp-now,embassy-net,defmt,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --no-default-features --features=async,wifi,esp-now,embassy-net,defmt,esp-hal/embassy-time-timg0 - name: build (all possible network options) if: ${{ matrix.chip != 'esp32h2' }} run: cd esp-wifi && for combo in {ipv4,},{ipv6,},{tcp,},{udp,},{igmp,},{dhcpv4,} ; do cargo b${{ matrix.chip }} --release --no-default-features --features=wifi,wifi-logs,$combo ; done @@ -95,35 +95,35 @@ jobs: run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=esp_now --features=esp-now - name: build (embassy_esp_now) if: ${{ matrix.chip != 'esp32h2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_esp_now --features=async,esp-now,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_esp_now --features=async,esp-now,esp-hal/embassy-time-timg0 - name: build (embassy_esp_now_duplex) if: ${{ matrix.chip != 'esp32h2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_esp_now_duplex --features=async,esp-now,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_esp_now_duplex --features=async,esp-now,esp-hal/embassy-time-timg0 - name: build (embassy_dhcp) if: ${{ matrix.chip != 'esp32h2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_dhcp --features=async,wifi,embassy-net,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_dhcp --features=async,wifi,embassy-net,esp-hal/embassy-time-timg0 - name: build (embassy_bench) if: ${{ matrix.chip != 'esp32h2' && matrix.chip != 'esp32s2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_bench --features=async,wifi,embassy-net,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_bench --features=async,wifi,embassy-net,esp-hal/embassy-time-timg0 - name: build (embassy_access_point) if: ${{ matrix.chip != 'esp32h2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_access_point --features=async,wifi,embassy-net,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_access_point --features=async,wifi,embassy-net,esp-hal/embassy-time-timg0 - name: build (embassy_access_point_with_sta) if: ${{ matrix.chip != 'esp32h2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_access_point_with_sta --features=async,wifi,embassy-net,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_access_point_with_sta --features=async,wifi,embassy-net,esp-hal/embassy-time-timg0 - name: build (common features + ble) if: ${{ matrix.chip != 'esp32s2' && matrix.chip != 'esp32h2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --features=async,wifi,ble,esp-now,embassy-net,log,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --features=async,wifi,ble,esp-now,embassy-net,log,esp-hal/embassy-time-timg0 - name: build (common features + ble + defmt) if: ${{ matrix.chip != 'esp32s2' && matrix.chip != 'esp32h2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --no-default-features --features=async,wifi,ble,esp-now,embassy-net,defmt,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --no-default-features --features=async,wifi,ble,esp-now,embassy-net,defmt,esp-hal/embassy-time-timg0 - name: build (ble) if: ${{ matrix.chip != 'esp32s2' }} run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=ble --no-default-features --features=ble - name: build (embassy_ble) if: ${{ matrix.chip != 'esp32s2' }} - run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_ble --no-default-features --features=async,ble,${{ matrix.chip }}-hal/embassy-time-timg0 + run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=embassy_ble --no-default-features --features=async,ble,esp-hal/embassy-time-timg0 - name: build (coex) if: ${{ matrix.chip == 'esp32' || matrix.chip == 'esp32s3' || matrix.chip == 'esp32c3' }} run: cd esp-wifi && cargo b${{ matrix.chip }} --release --example=coex --features=wifi,ble,coex diff --git a/CHANGELOG.md b/CHANGELOG.md index 52e58500..e0786ba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Users don't need embedded-svc to control wifi anymore. The wifi trait is optionally implemented now. (#429) - Better network performance by forced yielding of the task when buffers are full / empty. (#430) +- Depend on esp-hal 0.16.1, update other dependencies ### Removed diff --git a/Cargo.toml b/Cargo.toml index 71c26794..4877876b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,14 +8,8 @@ opt-level = 3 debug = true [workspace.dependencies] -defmt = "=0.3.5" -esp32c3-hal = { version = "0.15.0", default-features = false } -esp32c2-hal = { version = "0.13.0", default-features = false } -esp32c6-hal = { version = "0.8.0", default-features = false } -esp32h2-hal = { version = "0.6.0", default-features = false } -esp32-hal = { version = "0.18.0", default-features = false } -esp32s3-hal = { version = "0.15.0", default-features = false } -esp32s2-hal = { version = "0.15.0", default-features = false } +defmt = "0.3.6" +esp-hal = { version = "0.16.1", default-features = false } smoltcp = { version = "0.11.0", default-features = false, features = [ "medium-ethernet", "socket-raw", @@ -40,7 +34,7 @@ num-traits = { version = "0.2", default-features = false } esp-wifi-sys = { version = "0.1.0", path = "../esp-wifi-sys" } embassy-sync = { version = "0.5.0" } embassy-futures = { version = "0.1.0" } -toml-cfg = "0.1.3" +toml-cfg = "0.2.0" libm = "0.2.7" cfg-if = "1.0.0" static_cell = { version = "2.0", features = ["nightly"] } @@ -52,7 +46,7 @@ embassy-net = { version = "0.4.0", features = [ "dhcpv4", "medium-ethernet", ] } -bleps = { git = "https://github.com/bjoernQ/bleps", package = "bleps", rev = "be90de7", features = [ +bleps = { git = "https://github.com/bjoernQ/bleps", package = "bleps", rev = "9371d7d4d510ba5c936c1eef96674f8fd4f63e8a", features = [ "macros", ] } embassy-executor = { version = "0.5.0", package = "embassy-executor", features = [ @@ -60,8 +54,8 @@ embassy-executor = { version = "0.5.0", package = "embassy-executor", features = "integrated-timers", ] } embassy-time = { version = "0.3.0" } -esp-println = { version = "0.8.0", default-features = false } -esp-backtrace = { version = "0.10.0" } +esp-println = { version = "0.9.0", default-features = false } +esp-backtrace = { version = "0.11.0" } embedded-hal-async = { version = "1.0.0" } embedded-io-async = { version = "0.6.0" } diff --git a/esp-wifi/.cargo/config.toml b/esp-wifi/.cargo/config.toml index 1c694109..a52462b8 100644 --- a/esp-wifi/.cargo/config.toml +++ b/esp-wifi/.cargo/config.toml @@ -4,21 +4,21 @@ # - `embassy-time-timg0` as the examples assume we are using this time driver # - `embassy-executor-thread` on Xtensa chips to take advantage of the Xtensa specific executor we have in esp-hal [alias] -esp32 = "run --features esp32 --target xtensa-esp32-none-elf --features esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi-default" -esp32s2 = "run --features esp32s2 --target xtensa-esp32s2-none-elf --features esp32s2-hal/default,esp32s2-hal/embassy-time-timg0,esp32s2-hal/embassy-executor-thread,wifi-default" -esp32s3 = "run --features esp32s3 --target xtensa-esp32s3-none-elf --features esp32s3-hal/default,esp32s3-hal/embassy-time-timg0,esp32s3-hal/embassy-executor-thread,wifi-default" -esp32c2 = "run --features esp32c2 --target riscv32imc-unknown-none-elf --features esp32c2-hal/default,esp32c2-hal/embassy-time-timg0,esp32c2-hal/embassy-executor-thread,wifi-default" -esp32c3 = "run --features esp32c3 --target riscv32imc-unknown-none-elf --features esp32c3-hal/default,esp32c3-hal/embassy-time-timg0,esp32c3-hal/embassy-executor-thread,wifi-default" -esp32c6 = "run --features esp32c6 --target riscv32imac-unknown-none-elf --features esp32c6-hal/default,esp32c6-hal/embassy-time-timg0,esp32c6-hal/embassy-executor-thread,wifi-default" -esp32h2 = "run --features esp32h2 --target riscv32imac-unknown-none-elf --features esp32h2-hal/default,esp32h2-hal/embassy-time-timg0,esp32h2-hal/embassy-executor-thread" +esp32 = "run --features esp32 --target xtensa-esp32-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +esp32s2 = "run --features esp32s2 --target xtensa-esp32s2-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +esp32s3 = "run --features esp32s3 --target xtensa-esp32s3-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +esp32c2 = "run --features esp32c2 --target riscv32imc-unknown-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +esp32c3 = "run --features esp32c3 --target riscv32imc-unknown-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +esp32c6 = "run --features esp32c6 --target riscv32imac-unknown-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +esp32h2 = "run --features esp32h2 --target riscv32imac-unknown-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread" -besp32 = "build --features esp32 --target xtensa-esp32-none-elf --features esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi-default" -besp32s2 = "build --features esp32s2 --target xtensa-esp32s2-none-elf --features esp32s2-hal/default,esp32s2-hal/embassy-time-timg0,esp32s2-hal/embassy-executor-thread,wifi-default" -besp32s3 = "build --features esp32s3 --target xtensa-esp32s3-none-elf --features esp32s3-hal/default,esp32s3-hal/embassy-time-timg0,esp32s3-hal/embassy-executor-thread,wifi-default" -besp32c2 = "build --features esp32c2 --target riscv32imc-unknown-none-elf --features esp32c2-hal/default,esp32c2-hal/embassy-time-timg0,esp32c2-hal/embassy-executor-thread,wifi-default" -besp32c3 = "build --features esp32c3 --target riscv32imc-unknown-none-elf --features esp32c3-hal/default,esp32c3-hal/embassy-time-timg0,esp32c3-hal/embassy-executor-thread,wifi-default" -besp32c6 = "build --features esp32c6 --target riscv32imac-unknown-none-elf --features esp32c6-hal/default,esp32c6-hal/embassy-time-timg0,esp32c6-hal/embassy-executor-thread,wifi-default" -besp32h2 = "build --features esp32h2 --target riscv32imac-unknown-none-elf --features esp32h2-hal/default,esp32h2-hal/embassy-time-timg0,esp32h2-hal/embassy-executor-thread" +besp32 = "build --features esp32 --target xtensa-esp32-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +besp32s2 = "build --features esp32s2 --target xtensa-esp32s2-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +besp32s3 = "build --features esp32s3 --target xtensa-esp32s3-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +besp32c2 = "build --features esp32c2 --target riscv32imc-unknown-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +besp32c3 = "build --features esp32c3 --target riscv32imc-unknown-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +besp32c6 = "build --features esp32c6 --target riscv32imac-unknown-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi-default" +besp32h2 = "build --features esp32h2 --target riscv32imac-unknown-none-elf --features esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread" [target.riscv32imc-unknown-none-elf] runner = "espflash flash --monitor" diff --git a/esp-wifi/Cargo.toml b/esp-wifi/Cargo.toml index ee6401aa..7851d152 100644 --- a/esp-wifi/Cargo.toml +++ b/esp-wifi/Cargo.toml @@ -23,13 +23,7 @@ categories = [ [dependencies] defmt = { workspace = true, optional = true } -esp32c3-hal = { workspace = true, optional = true } -esp32c2-hal = { workspace = true, optional = true } -esp32c6-hal = { workspace = true, optional = true } -esp32h2-hal = { workspace = true, optional = true } -esp32-hal = { workspace = true, optional = true } -esp32s3-hal = { workspace = true, optional = true } -esp32s2-hal = { workspace = true, optional = true } +esp-hal = { workspace = true } smoltcp = { workspace = true, optional = true } critical-section.workspace = true log = { workspace = true, optional = true } @@ -60,11 +54,11 @@ atomic-waker.workspace = true toml-cfg.workspace = true [dev-dependencies] -esp-println = { workspace = true, features = ["log"] } +esp-println = { workspace = true, features = ["log", "uart"] } esp-backtrace = { workspace = true, features = [ "panic-handler", "exception-handler", - "print-uart", + "println", ] } embassy-executor.workspace = true embassy-time.workspace = true @@ -78,33 +72,21 @@ static_cell.workspace = true default = [ "log" ] # chip features -esp32c2 = [ "esp32c2-hal", "esp-wifi-sys/esp32c2", "esp-println/esp32c2", "esp-backtrace/esp32c2" ] -esp32c3 = [ "esp32c3-hal", "esp-wifi-sys/esp32c3", "esp-println/esp32c3", "esp-backtrace/esp32c3" ] -esp32c6 = [ "esp32c6-hal", "esp-wifi-sys/esp32c6", "esp-println/esp32c6", "esp-backtrace/esp32c6" ] -esp32h2 = [ "esp32h2-hal", "esp-wifi-sys/esp32h2", "esp-println/esp32h2", "esp-backtrace/esp32h2" ] -esp32 = [ "esp32-hal", "esp-wifi-sys/esp32", "esp-println/esp32", "esp-backtrace/esp32" ] -esp32s2 = [ "esp32s2-hal", "esp-wifi-sys/esp32s2", "esp-println/esp32s2", "esp-backtrace/esp32s2" ] -esp32s3 = [ "esp32s3-hal", "esp-wifi-sys/esp32s3", "esp-println/esp32s3", "esp-backtrace/esp32s3" ] +esp32c2 = [ "esp-hal/esp32c2", "esp-wifi-sys/esp32c2", "esp-println/esp32c2", "esp-backtrace/esp32c2" ] +esp32c3 = [ "esp-hal/esp32c3", "esp-wifi-sys/esp32c3", "esp-println/esp32c3", "esp-backtrace/esp32c3" ] +esp32c6 = [ "esp-hal/esp32c6", "esp-wifi-sys/esp32c6", "esp-println/esp32c6", "esp-backtrace/esp32c6" ] +esp32h2 = [ "esp-hal/esp32h2", "esp-wifi-sys/esp32h2", "esp-println/esp32h2", "esp-backtrace/esp32h2" ] +esp32 = [ "esp-hal/esp32", "esp-wifi-sys/esp32", "esp-println/esp32", "esp-backtrace/esp32" ] +esp32s2 = [ "esp-hal/esp32s2", "esp-wifi-sys/esp32s2", "esp-println/esp32s2", "esp-backtrace/esp32s2" ] +esp32s3 = [ "esp-hal/esp32s3", "esp-wifi-sys/esp32s3", "esp-println/esp32s3", "esp-backtrace/esp32s3" ] # async features async = [ "dep:embassy-sync", "dep:embassy-futures", "dep:embedded-io-async", - "esp32c3-hal?/embassy", - "esp32c2-hal?/embassy", - "esp32c6-hal?/embassy", - "esp32h2-hal?/embassy", - "esp32-hal?/embassy", - "esp32s2-hal?/embassy", - "esp32s3-hal?/embassy", - "esp32c3-hal?/async", - "esp32c2-hal?/async", - "esp32c6-hal?/async", - "esp32h2-hal?/async", - "esp32-hal?/async", - "esp32s2-hal?/async", - "esp32s3-hal?/async", + "esp-hal/embassy", + "esp-hal/async", ] embassy-net = ["dep:embassy-net-driver", "async"] @@ -118,7 +100,7 @@ utils = [ "smoltcp" ] enumset = [] wifi = [ "dep:enumset", "dep:no-std-net" ] embedded-svc = [ "dep:embedded-svc" ] -ble = [ "esp32-hal?/bluetooth" ] +ble = [ "esp-hal/bluetooth" ] phy-enable-usb = [] ps-min-modem = [] ps-max-modem = [] @@ -135,27 +117,15 @@ wifi-default = ["ipv4", "tcp", "udp", "icmp", "igmp", "dns", "dhcpv4"] defmt = [ "dep:defmt", "smoltcp?/defmt", - "esp32c3-hal?/defmt", - "esp32c2-hal?/defmt", - "esp32c6-hal?/defmt", - "esp32h2-hal?/defmt", - "esp32-hal?/defmt", - "esp32s2-hal?/defmt", - "esp32s3-hal?/defmt", + "esp-hal/defmt", ] log = [ "dep:log", - "esp32c3-hal?/log", - "esp32c2-hal?/log", - "esp32c6-hal?/log", - "esp32h2-hal?/log", - "esp32-hal?/log", - "esp32s2-hal?/log", - "esp32s3-hal?/log", + "esp-hal/log", ] [package.metadata.docs.rs] -features = ["esp32c3", "wifi", "ble", "coex", "async", "embassy-net", "esp32c3-hal/embassy-time-systick", "esp32c3-hal/default"] +features = ["esp32c3", "wifi", "ble", "coex", "async", "embassy-net", "esp-hal/embassy-time-systick", "esp-hal/default"] default-target = "riscv32imc-unknown-none-elf" # These examples are used in test automation diff --git a/esp-wifi/examples/embassy_ble.rs b/esp-wifi/examples/embassy_ble.rs index e33b33b6..460f8b38 100644 --- a/esp-wifi/examples/embassy_ble.rs +++ b/esp-wifi/examples/embassy_ble.rs @@ -144,19 +144,22 @@ async fn main(_spawner: Spawner) -> ! { let counter = RefCell::new(0u8); let counter = &counter; - let mut notifier = async || { + let mut notifier = || { // TODO how to check if notifications are enabled for the characteristic? - // maybe pass something into the closure which just can query the characterisic value + // maybe pass something into the closure which just can query the characteristic value // probably passing in the attribute server won't work? - pin_ref.borrow_mut().wait_for_rising_edge().await.unwrap(); - let mut data = [0u8; 13]; - data.copy_from_slice(b"Notification0"); - { - let mut counter = counter.borrow_mut(); - data[data.len() - 1] += *counter; - *counter = (*counter + 1) % 10; + + async { + pin_ref.borrow_mut().wait_for_rising_edge().await.unwrap(); + let mut data = [0u8; 13]; + data.copy_from_slice(b"Notification0"); + { + let mut counter = counter.borrow_mut(); + data[data.len() - 1] += *counter; + *counter = (*counter + 1) % 10; + } + NotificationData::new(my_characteristic_handle, &data) } - NotificationData::new(my_characteristic_handle, &data) }; srv.run(&mut notifier).await.unwrap(); diff --git a/esp-wifi/src/ble/os_adapter_esp32c3.rs b/esp-wifi/src/ble/os_adapter_esp32c3.rs index bcbf91fa..ea590463 100644 --- a/esp-wifi/src/ble/os_adapter_esp32c3.rs +++ b/esp-wifi/src/ble/os_adapter_esp32c3.rs @@ -1,5 +1,4 @@ use super::*; -use crate::binary::include::esp_bt_controller_config_t; pub(crate) static mut BT_INTERRUPT_FUNCTION5: ( *mut crate::binary::c_types::c_void, diff --git a/esp-wifi/src/lib.rs b/esp-wifi/src/lib.rs index cd7196cd..e52aedcf 100644 --- a/esp-wifi/src/lib.rs +++ b/esp-wifi/src/lib.rs @@ -7,6 +7,9 @@ #![doc = include_str!("../README.md")] #![doc(html_logo_url = "https://avatars.githubusercontent.com/u/46717278")] #![allow(rustdoc::bare_urls)] +// allow until num-derive doesn't generate this warning anymore (unknown_lints because Xtensa toolchain doesn't know about that lint, yet) +#![allow(unknown_lints)] +#![allow(non_local_definitions)] // MUST be the first module mod fmt; @@ -18,20 +21,7 @@ use core::ptr::addr_of_mut; use common_adapter::RADIO_CLOCKS; use critical_section::Mutex; -#[cfg(esp32)] -use esp32_hal as hal; -#[cfg(esp32c2)] -use esp32c2_hal as hal; -#[cfg(esp32c3)] -use esp32c3_hal as hal; -#[cfg(esp32c6)] -use esp32c6_hal as hal; -#[cfg(esp32h2)] -use esp32h2_hal as hal; -#[cfg(esp32s2)] -use esp32s2_hal as hal; -#[cfg(esp32s3)] -use esp32s3_hal as hal; +use esp_hal as hal; #[cfg(any(esp32c2, esp32c3, esp32c6, esp32h2))] use hal::systimer::{Alarm, Target}; @@ -74,7 +64,6 @@ pub mod tasks; pub(crate) mod memory_fence; -use critical_section; use timer::{get_systimer_count, ticks_to_millis}; #[cfg(all(feature = "wifi", any(feature = "tcp", feature = "udp")))] diff --git a/esp-wifi/src/wifi/mod.rs b/esp-wifi/src/wifi/mod.rs index fc17cd9a..ccd89ddc 100644 --- a/esp-wifi/src/wifi/mod.rs +++ b/esp-wifi/src/wifi/mod.rs @@ -26,7 +26,6 @@ use enumset::EnumSetType; use num_derive::FromPrimitive; use num_traits::FromPrimitive; -use core::convert::TryInto; use core::fmt::Debug; use core::mem; @@ -297,7 +296,6 @@ impl Configuration { } pub mod ipv4 { - use core::convert::TryFrom; use core::fmt::Display; use core::str::FromStr; @@ -2273,7 +2271,6 @@ mod asynch { use core::task::Poll; use embassy_sync::waitqueue::AtomicWaker; - use num_traits::FromPrimitive; use super::*; diff --git a/examples-util/util.rs b/examples-util/util.rs index 95db5f65..59f76324 100644 --- a/examples-util/util.rs +++ b/examples-util/util.rs @@ -1,19 +1,6 @@ #![allow(unused)] -#[cfg(feature = "esp32")] -pub use esp32_hal as hal; -#[cfg(feature = "esp32c2")] -pub use esp32c2_hal as hal; -#[cfg(feature = "esp32c3")] -pub use esp32c3_hal as hal; -#[cfg(feature = "esp32c6")] -pub use esp32c6_hal as hal; -#[cfg(feature = "esp32h2")] -pub use esp32h2_hal as hal; -#[cfg(feature = "esp32s2")] -pub use esp32s2_hal as hal; -#[cfg(feature = "esp32s3")] -pub use esp32s3_hal as hal; +pub use esp_hal as hal; #[cfg(any( feature = "esp32c2", diff --git a/run_tests.bat b/run_tests.bat index 3cc8fd72..9e80940f 100644 --- a/run_tests.bat +++ b/run_tests.bat @@ -8,71 +8,71 @@ mkdir tmp\esp32c6 mkdir tmp\esp32h2 cd esp-wifi -cargo +esp build --release --example esp_now_broadcaster --target xtensa-esp32-none-elf --features esp32,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi,esp-now -cargo +esp build --release --example test_esp_now --target xtensa-esp32-none-elf --features esp32,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi,esp-now -cargo +esp build --release --example open_access_point --target xtensa-esp32-none-elf --features esp32,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp -cargo +esp build --release --example test_connect --target xtensa-esp32-none-elf --features esp32,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp -cargo +esp build --release --example test_ble --target xtensa-esp32-none-elf --features esp32,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,ble +cargo +esp build --release --example esp_now_broadcaster --target xtensa-esp32-none-elf --features esp32,esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi,esp-now +cargo +esp build --release --example test_esp_now --target xtensa-esp32-none-elf --features esp32,esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi,esp-now +cargo +esp build --release --example open_access_point --target xtensa-esp32-none-elf --features esp32,esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp +cargo +esp build --release --example test_connect --target xtensa-esp32-none-elf --features esp32,esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp +cargo +esp build --release --example test_ble --target xtensa-esp32-none-elf --features esp32,esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,ble copy ..\target\xtensa-esp32-none-elf\release\examples\esp_now_broadcaster ..\tmp\esp32 copy ..\target\xtensa-esp32-none-elf\release\examples\test_esp_now ..\tmp\esp32 copy ..\target\xtensa-esp32-none-elf\release\examples\open_access_point ..\tmp\esp32 copy ..\target\xtensa-esp32-none-elf\release\examples\test_connect ..\tmp\esp32 copy ..\target\xtensa-esp32-none-elf\release\examples\test_ble ..\tmp\esp32 -cargo +esp build --release --example esp_now_broadcaster --target xtensa-esp32s2-none-elf --features esp32s2,esp32s2-hal/default,esp32s2-hal/embassy-time-timg0,esp32s2-hal/embassy-executor-thread,wifi,esp-now -cargo +esp build --release --example test_esp_now --target xtensa-esp32s2-none-elf --features esp32s2,esp32s2-hal/default,esp32s2-hal/embassy-time-timg0,esp32s2-hal/embassy-executor-thread,wifi,esp-now -cargo +esp build --release --example open_access_point --target xtensa-esp32s2-none-elf --features esp32s2,esp32s2-hal/default,esp32s2-hal/embassy-time-timg0,esp32s2-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp -cargo +esp build --release --example test_connect --target xtensa-esp32s2-none-elf --features esp32s2,esp32s2-hal/default,esp32s2-hal/embassy-time-timg0,esp32s2-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp +cargo +esp build --release --example esp_now_broadcaster --target xtensa-esp32s2-none-elf --features esp32s2,esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi,esp-now +cargo +esp build --release --example test_esp_now --target xtensa-esp32s2-none-elf --features esp32s2,esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi,esp-now +cargo +esp build --release --example open_access_point --target xtensa-esp32s2-none-elf --features esp32s2,esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp +cargo +esp build --release --example test_connect --target xtensa-esp32s2-none-elf --features esp32s2,esp-hal/default,esp-hal/embassy-time-timg0,esp-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp copy ..\target\xtensa-esp32s2-none-elf\release\examples\esp_now_broadcaster ..\tmp\esp32s2 copy ..\target\xtensa-esp32s2-none-elf\release\examples\test_esp_now ..\tmp\esp32s2 copy ..\target\xtensa-esp32s2-none-elf\release\examples\open_access_point ..\tmp\esp32s2 copy ..\target\xtensa-esp32s2-none-elf\release\examples\test_connect ..\tmp\esp32s2 -cargo +esp build --release --example esp_now_broadcaster --target xtensa-esp32s3-none-elf --features esp32s3,esp32s3-hal/default,esp32s3-hal/embassy-time-timg0,esp32s3-hal/embassy-executor-thread,wifi,esp-now -cargo +esp build --release --example test_esp_now --target xtensa-esp32s3-none-elf --features esp32s3,esp32s3-hal/default,esp32s3-hal/embassy-time-timg0,esp32s3-hal/embassy-executor-thread,wifi,esp-now -cargo +esp build --release --example open_access_point --target xtensa-esp32s3-none-elf --features esp32s3,esp32s3-hal/default,esp32s3-hal/embassy-time-timg0,esp32s3-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp -cargo +esp build --release --example test_connect --target xtensa-esp32s3-none-elf --features esp32s3,esp32s3-hal/default,esp32s3-hal/embassy-time-timg0,esp32s3-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp -cargo +esp build --release --example test_ble --target xtensa-esp32s3-none-elf --features esp32s3,esp32s3-hal/default,esp32s3-hal/embassy-time-timg0,esp32s3-hal/embassy-executor-thread,ble +cargo +esp build --release --example esp_now_broadcaster --target xtensa-esp32s3-none-elf --features esp32s3,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi,esp-now +cargo +esp build --release --example test_esp_now --target xtensa-esp32s3-none-elf --features esp32s3,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi,esp-now +cargo +esp build --release --example open_access_point --target xtensa-esp32s3-none-elf --features esp32s3,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp +cargo +esp build --release --example test_connect --target xtensa-esp32s3-none-elf --features esp32s3,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,wifi,esp-now,utils,smoltcp,tcp +cargo +esp build --release --example test_ble --target xtensa-esp32s3-none-elf --features esp32s3,esp32-hal/default,esp32-hal/embassy-time-timg0,esp32-hal/embassy-executor-thread,ble copy ..\target\xtensa-esp32s3-none-elf\release\examples\esp_now_broadcaster ..\tmp\esp32s3 copy ..\target\xtensa-esp32s3-none-elf\release\examples\test_esp_now ..\tmp\esp32s3 copy ..\target\xtensa-esp32s3-none-elf\release\examples\open_access_point ..\tmp\esp32s3 copy ..\target\xtensa-esp32s3-none-elf\release\examples\test_connect ..\tmp\esp32s3 copy ..\target\xtensa-esp32s3-none-elf\release\examples\test_ble ..\tmp\esp32s3 -cargo +nightly build --release --example esp_now_broadcaster --target riscv32imc-unknown-none-elf --features esp32c2,esp32c2-hal/default,esp32c2-hal/embassy-time-timg0,wifi,esp-now -cargo +nightly build --release --example test_esp_now --target riscv32imc-unknown-none-elf --features esp32c2,esp32c2-hal/default,esp32c2-hal/embassy-time-timg0,wifi,esp-now -cargo +nightly build --release --example open_access_point --target riscv32imc-unknown-none-elf --features esp32c2,esp32c2-hal/default,esp32c2-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp -cargo +nightly build --release --example test_connect --target riscv32imc-unknown-none-elf --features esp32c2,esp32c2-hal/default,esp32c2-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp -cargo +nightly build --release --example test_ble --target riscv32imc-unknown-none-elf --features esp32c2,esp32c2-hal/default,esp32c2-hal/embassy-time-timg0,ble +cargo +nightly build --release --example esp_now_broadcaster --target riscv32imc-unknown-none-elf --features esp32c2,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now +cargo +nightly build --release --example test_esp_now --target riscv32imc-unknown-none-elf --features esp32c2,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now +cargo +nightly build --release --example open_access_point --target riscv32imc-unknown-none-elf --features esp32c2,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp +cargo +nightly build --release --example test_connect --target riscv32imc-unknown-none-elf --features esp32c2,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp +cargo +nightly build --release --example test_ble --target riscv32imc-unknown-none-elf --features esp32c2,esp-hal/default,esp-hal/embassy-time-timg0,ble copy ..\target\riscv32imc-unknown-none-elf\release\examples\esp_now_broadcaster ..\tmp\esp32c2 copy ..\target\riscv32imc-unknown-none-elf\release\examples\test_esp_now ..\tmp\esp32c2 copy ..\target\riscv32imc-unknown-none-elf\release\examples\open_access_point ..\tmp\esp32c2 copy ..\target\riscv32imc-unknown-none-elf\release\examples\test_connect ..\tmp\esp32c2 copy ..\target\riscv32imc-unknown-none-elf\release\examples\test_ble ..\tmp\esp32c2 -cargo +nightly build --release --example esp_now_broadcaster --target riscv32imc-unknown-none-elf --features esp32c3,esp32c3-hal/default,esp32c3-hal/embassy-time-timg0,wifi,esp-now -cargo +nightly build --release --example test_esp_now --target riscv32imc-unknown-none-elf --features esp32c3,esp32c3-hal/default,esp32c3-hal/embassy-time-timg0,wifi,esp-now -cargo +nightly build --release --example open_access_point --target riscv32imc-unknown-none-elf --features esp32c3,esp32c3-hal/default,esp32c3-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp -cargo +nightly build --release --example test_connect --target riscv32imc-unknown-none-elf --features esp32c3,esp32c3-hal/default,esp32c3-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp -cargo +nightly build --release --example test_ble --target riscv32imc-unknown-none-elf --features esp32c3,esp32c3-hal/default,esp32c3-hal/embassy-time-timg0,ble +cargo +nightly build --release --example esp_now_broadcaster --target riscv32imc-unknown-none-elf --features esp32c3,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now +cargo +nightly build --release --example test_esp_now --target riscv32imc-unknown-none-elf --features esp32c3,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now +cargo +nightly build --release --example open_access_point --target riscv32imc-unknown-none-elf --features esp32c3,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp +cargo +nightly build --release --example test_connect --target riscv32imc-unknown-none-elf --features esp32c3,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp +cargo +nightly build --release --example test_ble --target riscv32imc-unknown-none-elf --features esp32c3,esp-hal/default,esp-hal/embassy-time-timg0,ble copy ..\target\riscv32imc-unknown-none-elf\release\examples\esp_now_broadcaster ..\tmp\esp32c3 copy ..\target\riscv32imc-unknown-none-elf\release\examples\test_esp_now ..\tmp\esp32c3 copy ..\target\riscv32imc-unknown-none-elf\release\examples\open_access_point ..\tmp\esp32c3 copy ..\target\riscv32imc-unknown-none-elf\release\examples\test_connect ..\tmp\esp32c3 copy ..\target\riscv32imc-unknown-none-elf\release\examples\test_ble ..\tmp\esp32c3 -cargo +nightly build --release --example esp_now_broadcaster --target riscv32imac-unknown-none-elf --features esp32c6,esp32c6-hal/default,esp32c6-hal/embassy-time-timg0,wifi,esp-now -cargo +nightly build --release --example test_esp_now --target riscv32imac-unknown-none-elf --features esp32c6,esp32c6-hal/default,esp32c6-hal/embassy-time-timg0,wifi,esp-now -cargo +nightly build --release --example open_access_point --target riscv32imac-unknown-none-elf --features esp32c6,esp32c6-hal/default,esp32c6-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp -cargo +nightly build --release --example test_connect --target riscv32imac-unknown-none-elf --features esp32c6,esp32c6-hal/default,esp32c6-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp -cargo +nightly build --release --example test_ble --target riscv32imac-unknown-none-elf --features esp32c6,esp32c6-hal/default,esp32c6-hal/embassy-time-timg0,ble +cargo +nightly build --release --example esp_now_broadcaster --target riscv32imac-unknown-none-elf --features esp32c6,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now +cargo +nightly build --release --example test_esp_now --target riscv32imac-unknown-none-elf --features esp32c6,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now +cargo +nightly build --release --example open_access_point --target riscv32imac-unknown-none-elf --features esp32c6,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp +cargo +nightly build --release --example test_connect --target riscv32imac-unknown-none-elf --features esp32c6,esp-hal/default,esp-hal/embassy-time-timg0,wifi,esp-now,utils,smoltcp,tcp +cargo +nightly build --release --example test_ble --target riscv32imac-unknown-none-elf --features esp32c6,esp-hal/default,esp-hal/embassy-time-timg0,ble copy ..\target\riscv32imac-unknown-none-elf\release\examples\esp_now_broadcaster ..\tmp\esp32c6 copy ..\target\riscv32imac-unknown-none-elf\release\examples\test_esp_now ..\tmp\esp32c6 copy ..\target\riscv32imac-unknown-none-elf\release\examples\open_access_point ..\tmp\esp32c6 copy ..\target\riscv32imac-unknown-none-elf\release\examples\test_connect ..\tmp\esp32c6 copy ..\target\riscv32imac-unknown-none-elf\release\examples\test_ble ..\tmp\esp32c6 -cargo +nightly build --release --example test_ble --target riscv32imac-unknown-none-elf --no-default-features --features esp32h2,esp32h2-hal/default,esp32h2-hal/embassy-time-timg0,ble +cargo +nightly build --release --example test_ble --target riscv32imac-unknown-none-elf --no-default-features --features esp32h2,esp-hal/default,esp-hal/embassy-time-timg0,ble copy ..\target\riscv32imac-unknown-none-elf\release\examples\test_ble ..\tmp\esp32h2 cd ..\tmp