From 96dac253b5225c5faeed29cbd30525cb56eaeefd Mon Sep 17 00:00:00 2001 From: Alex Moon Date: Mon, 4 Dec 2023 16:54:49 -0500 Subject: [PATCH] Update embassy and remove nightly requirement --- Cargo.toml | 10 +- ci.sh | 112 +++++++++--------- examples/Cargo.toml | 32 ++--- examples/src/bin/ble_advertise.rs | 1 - examples/src/bin/ble_bas_central.rs | 1 - examples/src/bin/ble_bas_peripheral.rs | 1 - examples/src/bin/ble_bas_peripheral_notify.rs | 1 - examples/src/bin/ble_bond_peripheral.rs | 1 - .../src/bin/ble_dis_bas_peripheral_builder.rs | 1 - examples/src/bin/ble_l2cap_central.rs | 1 - examples/src/bin/ble_l2cap_peripheral.rs | 1 - examples/src/bin/ble_peripheral_onoff.rs | 1 - examples/src/bin/ble_scan.rs | 1 - examples/src/bin/flash.rs | 1 - nrf-softdevice/Cargo.toml | 12 +- nrf-softdevice/src/ble/gatt_traits.rs | 7 +- nrf-softdevice/src/ble/mod.rs | 4 +- nrf-softdevice/src/flash.rs | 3 - nrf-softdevice/src/lib.rs | 2 - rust-toolchain.toml | 2 +- 20 files changed, 90 insertions(+), 105 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ff669183..affb52b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,11 +16,11 @@ members = [ exclude = ["nrf-softdevice-gen"] [patch.crates-io] -embassy-nrf = { git = "https://github.com/embassy-rs/embassy", rev = "ce662766be80d75b5f9294ae4b792f7db252ccd3" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "ce662766be80d75b5f9294ae4b792f7db252ccd3" } -embassy-macros = { git = "https://github.com/embassy-rs/embassy", rev = "ce662766be80d75b5f9294ae4b792f7db252ccd3" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "ce662766be80d75b5f9294ae4b792f7db252ccd3" } -embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "ce662766be80d75b5f9294ae4b792f7db252ccd3" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy", rev = "85d5f42562ca9374e3200d652616af9533346c5e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "85d5f42562ca9374e3200d652616af9533346c5e" } +embassy-macros = { git = "https://github.com/embassy-rs/embassy", rev = "85d5f42562ca9374e3200d652616af9533346c5e" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "85d5f42562ca9374e3200d652616af9533346c5e" } +embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "85d5f42562ca9374e3200d652616af9533346c5e" } [profile.release] codegen-units = 1 diff --git a/ci.sh b/ci.sh index 2bfcfea3..834a3b88 100755 --- a/ci.sh +++ b/ci.sh @@ -13,70 +13,70 @@ set -euxo pipefail cd nrf-softdevice -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server,defmt -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server,log +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server,defmt +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server,log # build softdevice+chip combinations (with all supported features enabled) # This htis each softdevice and each chip at least once. #================================================================================ -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s112,nrf52805,ble-sec,ble-peripheral,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s113,nrf52810,ble-sec,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s122,nrf52833,ble-central,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s132,nrf52832,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52811,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52820,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s112,nrf52805,ble-sec,ble-peripheral,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s113,nrf52810,ble-sec,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s122,nrf52833,ble-central,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s132,nrf52832,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52811,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52820,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server # build all feature combinations #================================== -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-peripheral -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-peripheral,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-peripheral,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-peripheral,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-peripheral,ble-l2cap -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-peripheral,ble-l2cap,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-peripheral,ble-l2cap,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server - -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-l2cap -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-l2cap,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-l2cap,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-l2cap,ble-gatt-client,ble-gatt-server - -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-peripheral -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-peripheral,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-peripheral,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-peripheral,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-peripheral,ble-l2cap -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-peripheral,ble-l2cap,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server,ble-l2cap-credit-wrokaround,ble-rssi - -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-peripheral -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-peripheral,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-peripheral,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-peripheral,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-peripheral,ble-l2cap -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-peripheral,ble-l2cap,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-peripheral,ble-l2cap,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server - -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server -cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features nightly,s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server,ble-l2cap-credit-wrokaround,ble-rssi +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-peripheral +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-peripheral,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-peripheral,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-peripheral,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-peripheral,ble-l2cap +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-peripheral,ble-l2cap,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-peripheral,ble-l2cap,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server + +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-l2cap +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-l2cap,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-l2cap,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-l2cap,ble-gatt-client,ble-gatt-server + +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-peripheral +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-peripheral,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-peripheral,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-peripheral,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-peripheral,ble-l2cap +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-peripheral,ble-l2cap,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server,ble-l2cap-credit-wrokaround,ble-rssi + +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-peripheral +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-peripheral,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-peripheral,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-peripheral,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-peripheral,ble-l2cap +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-peripheral,ble-l2cap,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-peripheral,ble-l2cap,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server + +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server +cargo build --target thumbv7em-none-eabihf -p nrf-softdevice --features s140,nrf52840,ble-sec,ble-central,ble-peripheral,ble-l2cap,ble-gatt-client,ble-gatt-server,ble-l2cap-credit-wrokaround,ble-rssi diff --git a/examples/Cargo.toml b/examples/Cargo.toml index bd8bf3f4..56544211 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -18,24 +18,24 @@ ble-gatt-client = ["nrf-softdevice/ble-gatt-client"] ble-sec = ["nrf-softdevice/ble-sec"] [dependencies] -embassy-executor = { version = "0.3.0", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "nightly", "defmt", "integrated-timers"]} -embassy-time = { version = "0.1.0", features = ["nightly", "defmt", "defmt-timestamp-uptime"]} -embassy-sync = { version = "0.2.0" } -embassy-nrf = { version = "0.1.0", features = [ "nightly", "defmt", "nrf52840", "gpiote", "time-driver-rtc1" ]} -cortex-m = "0.7.2" -cortex-m-rt = "0.7.0" -defmt = "0.3" +embassy-executor = { version = "0.3.3", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"]} +embassy-time = { version = "0.2.0", features = ["defmt", "defmt-timestamp-uptime"]} +embassy-sync = { version = "0.5.0" } +embassy-nrf = { version = "0.1.0", features = ["defmt", "nrf52840", "gpiote", "time-driver-rtc1" ]} +cortex-m = "0.7.7" +cortex-m-rt = "0.7.3" +defmt = "0.3.5" defmt-rtt = "0.4.0" -panic-probe = { version = "0.3", features= ["print-defmt"] } -nrf-softdevice = { version = "0.1.0", path = "../nrf-softdevice", features = ["nightly", "defmt", "nrf52840", "s140", "ble-peripheral", "ble-central", "critical-section-impl"] } +panic-probe = { version = "0.3.1", features= ["print-defmt"] } +nrf-softdevice = { version = "0.1.0", path = "../nrf-softdevice", features = ["defmt", "nrf52840", "s140", "ble-peripheral", "ble-central", "critical-section-impl"] } nrf-softdevice-s140 = { version = "0.1.1", path = "../nrf-softdevice-s140" } -embedded-storage = "0.3.0" -embedded-storage-async = "0.4.0" -futures = { version = "0.3.5", default-features = false } -fixed = "1.2.0" -heapless = "0.7.1" -atomic-pool = "1.0.0" -static_cell = "1.0.0" +embedded-storage = "0.3.1" +embedded-storage-async = "0.4.1" +futures = { version = "0.3.29", default-features = false } +fixed = "1.24.0" +heapless = "0.8.0" +atomic-pool = "1.0.1" +static_cell = "2.0.0" [[bin]] name = "ble_bas_peripheral" diff --git a/examples/src/bin/ble_advertise.rs b/examples/src/bin/ble_advertise.rs index 46cfa3ac..a80846ab 100644 --- a/examples/src/bin/ble_advertise.rs +++ b/examples/src/bin/ble_advertise.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/ble_bas_central.rs b/examples/src/bin/ble_bas_central.rs index 1e8f0752..27ac7242 100644 --- a/examples/src/bin/ble_bas_central.rs +++ b/examples/src/bin/ble_bas_central.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs index 2437850e..191c360e 100644 --- a/examples/src/bin/ble_bas_peripheral.rs +++ b/examples/src/bin/ble_bas_peripheral.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/ble_bas_peripheral_notify.rs b/examples/src/bin/ble_bas_peripheral_notify.rs index 83349075..16199e6f 100644 --- a/examples/src/bin/ble_bas_peripheral_notify.rs +++ b/examples/src/bin/ble_bas_peripheral_notify.rs @@ -18,7 +18,6 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/ble_bond_peripheral.rs b/examples/src/bin/ble_bond_peripheral.rs index 7f2e265f..38f0b62d 100644 --- a/examples/src/bin/ble_bond_peripheral.rs +++ b/examples/src/bin/ble_bond_peripheral.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/ble_dis_bas_peripheral_builder.rs b/examples/src/bin/ble_dis_bas_peripheral_builder.rs index 447e045a..30b841b1 100644 --- a/examples/src/bin/ble_dis_bas_peripheral_builder.rs +++ b/examples/src/bin/ble_dis_bas_peripheral_builder.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs index 22bfecca..cbbe3708 100644 --- a/examples/src/bin/ble_l2cap_central.rs +++ b/examples/src/bin/ble_l2cap_central.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/ble_l2cap_peripheral.rs b/examples/src/bin/ble_l2cap_peripheral.rs index ea4b5fda..bf08f93b 100644 --- a/examples/src/bin/ble_l2cap_peripheral.rs +++ b/examples/src/bin/ble_l2cap_peripheral.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs index 7393a9ee..71efaf32 100644 --- a/examples/src/bin/ble_peripheral_onoff.rs +++ b/examples/src/bin/ble_peripheral_onoff.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/ble_scan.rs b/examples/src/bin/ble_scan.rs index cd1621b4..302cca6b 100644 --- a/examples/src/bin/ble_scan.rs +++ b/examples/src/bin/ble_scan.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/examples/src/bin/flash.rs b/examples/src/bin/flash.rs index 81e65e6d..7b32eba6 100644 --- a/examples/src/bin/flash.rs +++ b/examples/src/bin/flash.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(type_alias_impl_trait)] #[path = "../example_common.rs"] mod example_common; diff --git a/nrf-softdevice/Cargo.toml b/nrf-softdevice/Cargo.toml index c790a952..0677347b 100644 --- a/nrf-softdevice/Cargo.toml +++ b/nrf-softdevice/Cargo.toml @@ -34,8 +34,6 @@ critical-section-impl = ["critical-section/restore-state-bool"] usable-from-interrupts = [] -nightly = ["dep:embedded-storage-async"] - # Workaround l2cap credit bug. If set, infinite credits are issued # to the peer in batches. The `credits` config when establishing the channel is ignored. # https://devzone.nordicsemi.com/f/nordic-q-a/81894/s140-7-3-0-softdevice-assertion-failed-at-pc-0xa806-using-l2cap @@ -50,15 +48,15 @@ log = { version = "0.4.11", optional = true } critical-section = { version = "1.0", optional = true } num_enum = { version = "0.7.0", default-features = false } -embassy-sync = { version = "0.2.0" } -embassy-futures = { version = "0.1.0" } +embassy-sync = { version = "0.5.0" } +embassy-futures = { version = "0.1.1" } cortex-m = "0.7.2" cortex-m-rt = ">=0.6.15,<0.8" -heapless = "0.7.1" +heapless = "0.8.0" fixed = "1.5.0" futures = { version = "0.3.17", default-features = false } -embedded-storage = "0.3.0" -embedded-storage-async = { version = "0.4.0", optional = true } +embedded-storage = "0.3.1" +embedded-storage-async = { version = "0.4.1" } nrf52805-pac = { version = "0.12.0", features = ["rt"], optional = true } nrf52810-pac = { version = "0.12.0", features = ["rt"], optional = true } diff --git a/nrf-softdevice/src/ble/gatt_traits.rs b/nrf-softdevice/src/ble/gatt_traits.rs index c1521640..a72a4d3d 100644 --- a/nrf-softdevice/src/ble/gatt_traits.rs +++ b/nrf-softdevice/src/ble/gatt_traits.rs @@ -126,9 +126,10 @@ impl GattValue for String { const MAX_SIZE: usize = N; fn from_gatt(data: &[u8]) -> Self { - String::from(unwrap!( - core::str::from_utf8(data).map_err(|_| FromGattError::InvalidCharacter) - )) + unwrap!( + String::from_utf8(unwrap!(Vec::from_slice(data).map_err(|_| FromGattError::InvalidLength))) + .map_err(|_| FromGattError::InvalidCharacter) + ) } fn to_gatt(&self) -> &[u8] { diff --git a/nrf-softdevice/src/ble/mod.rs b/nrf-softdevice/src/ble/mod.rs index 0cf311ff..e6045cdc 100644 --- a/nrf-softdevice/src/ble/mod.rs +++ b/nrf-softdevice/src/ble/mod.rs @@ -9,7 +9,6 @@ mod types; pub use connection::*; pub use gap::*; pub use gatt_traits::*; -pub use replies::*; pub use types::*; mod common; @@ -32,6 +31,9 @@ pub mod gatt_server; #[cfg(feature = "ble-l2cap")] pub mod l2cap; +#[cfg(any(feature = "ble-gatt-server", feature = "ble-sec"))] +pub use replies::*; + use core::mem; use crate::{raw, RawError, Softdevice}; diff --git a/nrf-softdevice/src/flash.rs b/nrf-softdevice/src/flash.rs index 69fc2036..a1496113 100644 --- a/nrf-softdevice/src/flash.rs +++ b/nrf-softdevice/src/flash.rs @@ -4,7 +4,6 @@ use core::sync::atomic::{AtomicBool, Ordering}; use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; use embassy_sync::signal::Signal; use embedded_storage::nor_flash::{ErrorType, NorFlashError, NorFlashErrorKind, ReadNorFlash}; -#[cfg(feature = "nightly")] use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; use crate::util::DropBomb; @@ -88,7 +87,6 @@ impl ReadNorFlash for Flash { } } -#[cfg(feature = "nightly")] impl AsyncReadNorFlash for Flash { const READ_SIZE: usize = 1; @@ -101,7 +99,6 @@ impl AsyncReadNorFlash for Flash { } } -#[cfg(feature = "nightly")] impl AsyncNorFlash for Flash { const WRITE_SIZE: usize = 4; const ERASE_SIZE: usize = 4096; diff --git a/nrf-softdevice/src/lib.rs b/nrf-softdevice/src/lib.rs index e7e62501..fd26a1b1 100644 --- a/nrf-softdevice/src/lib.rs +++ b/nrf-softdevice/src/lib.rs @@ -1,6 +1,4 @@ #![no_std] -#![cfg_attr(feature = "nightly", feature(async_fn_in_trait))] -#![cfg_attr(feature = "nightly", feature(impl_trait_projections))] #![allow(incomplete_features)] pub(crate) mod util; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 78269665..81628c26 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ # Before upgrading check that everything is available on all tier1 targets here: # https://rust-lang.github.io/rustup-components-history [toolchain] -channel = "nightly-2023-08-19" +channel = "beta" components = ["rust-src", "rustfmt"] targets = ["thumbv7em-none-eabihf"]