Skip to content

Commit 74e02ac

Browse files
authored
Merge pull request #24 from thermigo/bump-deps
Update Dependencies and Rust Version
2 parents 9ced9b4 + ac93f5f commit 74e02ac

File tree

21 files changed

+139
-111
lines changed

21 files changed

+139
-111
lines changed

btmesh-bearer/Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ edition = "2021"
88
[dependencies]
99
btmesh-common = { path = "../btmesh-common" }
1010
btmesh-pdu = { path = "../btmesh-pdu" }
11-
heapless = "0.7"
12-
defmt = {version = "0.3.0", optional = true }
11+
heapless = "0.8"
12+
defmt = { version = "0.3.0", optional = true }
1313

1414
[features]
15-
defmt = [
16-
"dep:defmt",
17-
]
15+
defmt = ["dep:defmt"]

btmesh-common/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ edition = "2021"
99
aes = { version = "0.7.5", default-features = false }
1010
ccm = { version = "0.4.4", default-features = false }
1111
cmac = { version = "0.6.0", default-features = false }
12-
heapless = "0.7"
12+
heapless = "0.8"
1313
hash32 = { version = "0.2.1", default-features = false }
1414
hash32-derive = { version = "0.1.1", default-features = false }
1515
rand_core = { version = "0.6.2", default-features = false }
@@ -29,7 +29,7 @@ syn = { version = "1.0.89", default-features = false, features = [
2929

3030
[features]
3131
darling = ["dep:darling", "dep:syn"]
32-
defmt = ["dep:defmt", "heapless/defmt-impl"]
32+
defmt = ["dep:defmt", "heapless/defmt-03"]
3333
relay = []
3434
proxy = []
3535
friend = []

btmesh-device/Cargo.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
heapless = "0.7"
9+
heapless = "0.8"
1010
btmesh-common = { path = "../btmesh-common" }
1111
btmesh-models = { path = "../btmesh-models" }
12-
embassy-sync = { version = "0.3.0", default-features = false }
13-
embassy-time = { version = "0.1.3", default-features = false }
12+
embassy-sync = { version = "0.6.0", default-features = false }
13+
embassy-time = { version = "0.3.2", default-features = false }
1414
embassy-futures = { version = "0.1.0", default-features = false }
1515
futures = { version = "0.3.21", default-features = false }
1616

@@ -19,4 +19,9 @@ log = { version = "0.4", optional = true }
1919
defmt = { version = "0.3", optional = true }
2020

2121
[features]
22-
defmt = ["dep:defmt", "heapless/defmt-impl"]
22+
defmt = ["dep:defmt", "heapless/defmt-03"]
23+
24+
[patch.crates-io]
25+
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
26+
embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
27+
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }

btmesh-device/src/lib.rs

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![cfg_attr(not(test), no_std)]
22
#![feature(associated_type_defaults)]
3-
#![feature(async_fn_in_trait)]
43
#![allow(incomplete_features)]
54
#![allow(dead_code)]
65

@@ -166,19 +165,27 @@ pub trait BluetoothMeshDeviceContext {
166165
inbound: InboundChannelReceiver,
167166
) -> Self::ElementContext;
168167

169-
async fn receive(&self) -> AccessCountedHandle<'static, InboundPayload>;
168+
fn receive(
169+
&self,
170+
) -> impl core::future::Future<Output = AccessCountedHandle<'static, InboundPayload>>;
170171
}
171172

172173
pub trait BluetoothMeshDevice {
173174
fn composition(&self) -> Composition<CompositionExtra>;
174175

175-
async fn run<C: BluetoothMeshDeviceContext>(&mut self, ctx: C) -> Result<(), ()>;
176+
fn run<C: BluetoothMeshDeviceContext>(
177+
&mut self,
178+
ctx: C,
179+
) -> impl core::future::Future<Output = Result<(), ()>>;
176180
}
177181

178182
pub trait BluetoothMeshElement {
179183
fn populate(&self, composition: &mut Composition<CompositionExtra>);
180184

181-
async fn run<C: BluetoothMeshElementContext>(&mut self, ctx: C) -> Result<(), ()>;
185+
fn run<C: BluetoothMeshElementContext>(
186+
&mut self,
187+
ctx: C,
188+
) -> impl core::future::Future<Output = Result<(), ()>>;
182189
}
183190

184191
pub trait BluetoothMeshElementContext {
@@ -192,13 +199,18 @@ pub trait BluetoothMeshElementContext {
192199
inbound: InboundModelChannelReceiver<'m, M::Message>,
193200
) -> Self::ModelContext<'m, M>;
194201

195-
async fn receive(&self) -> AccessCountedHandle<'static, InboundPayload>;
202+
fn receive(
203+
&self,
204+
) -> impl core::future::Future<Output = AccessCountedHandle<'static, InboundPayload>>;
196205
}
197206

198207
pub trait BluetoothMeshModel<M: Model> {
199208
type Model: Model = M;
200209

201-
async fn run<C: BluetoothMeshModelContext<M>>(&mut self, ctx: C) -> Result<(), ()>;
210+
fn run<C: BluetoothMeshModelContext<M>>(
211+
&mut self,
212+
ctx: C,
213+
) -> impl core::future::Future<Output = Result<(), ()>>;
202214

203215
fn model_identifier(&self) -> ModelIdentifier {
204216
M::IDENTIFIER
@@ -213,18 +225,22 @@ pub type ParseFunction<M> =
213225
for<'r> fn(&Opcode, &'r [u8]) -> Result<Option<<M as Model>::Message>, ParseError>;
214226

215227
pub trait BluetoothMeshModelContext<M: Model> {
216-
async fn receive(&self) -> InboundModelPayload<M::Message>;
228+
fn receive(&self) -> impl core::future::Future<Output = InboundModelPayload<M::Message>>;
217229

218-
async fn send(&self, message: M::Message, meta: OutboundMetadata) -> Result<(), ()>;
230+
fn send(
231+
&self,
232+
message: M::Message,
233+
meta: OutboundMetadata,
234+
) -> impl core::future::Future<Output = Result<(), ()>>;
219235

220-
async fn send_with_completion(
236+
fn send_with_completion(
221237
&self,
222238
message: M::Message,
223239
meta: OutboundMetadata,
224240
signal: &'static Signal<CompletionStatus>,
225-
) -> CompletionStatus;
241+
) -> impl core::future::Future<Output = CompletionStatus>;
226242

227-
async fn publish(&self, message: M::Message) -> Result<(), ()>;
243+
fn publish(&self, message: M::Message) -> impl core::future::Future<Output = Result<(), ()>>;
228244
}
229245

230246
pub enum CompletionStatus {

btmesh-driver/Cargo.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ btmesh-bearer = { path = "../btmesh-bearer" }
1212
btmesh-device = { path = "../btmesh-device" }
1313
btmesh-models = { path = "../btmesh-models", features = ["serde"] }
1414
btmesh-macro = { path = "../btmesh-macro" }
15-
embassy-time = { version = "0.1.3", default-features = false }
16-
embassy-sync = { version = "0.3.0", default-features = false, features = [
17-
"nightly",
18-
] }
15+
embassy-time = { version = "0.3.2", default-features = false }
16+
embassy-sync = { version = "0.6.0" }
1917
critical-section = { version = "1.1.1", default-features = false, optional = true }
2018
embassy-futures = { version = "0.1.0", default-features = false }
21-
heapless = "0.7"
19+
heapless = "0.8"
2220
hash32 = "0.2.1"
2321
hash32-derive = "0.1.1"
2422
uluru = "3.0.0"
@@ -33,6 +31,7 @@ postcard = { version = "1.0.1", default-features = false, features = [
3331
"heapless",
3432
], optional = true }
3533
defmt = { version = "0.3", optional = true }
34+
log = { version = "0.4", optional = true }
3635

3736
[dev-dependencies]
3837
rand_core = { version = "0.6.2", default-features = false, features = [
@@ -60,8 +59,14 @@ defmt = [
6059
"btmesh-models/defmt",
6160
"btmesh-pdu/defmt",
6261
]
62+
log = ["dep:log"]
6363

6464
relay = ["btmesh-common/relay", "btmesh-models/relay"]
6565
proxy = ["btmesh-common/proxy"]
6666
friend = ["btmesh-common/friend"]
6767
low_power = ["btmesh-common/low_power"]
68+
69+
[patch.crates-io]
70+
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
71+
embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
72+
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }

btmesh-driver/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![cfg_attr(not(test), no_std)]
22
#![feature(type_alias_impl_trait)]
3-
#![feature(async_fn_in_trait)]
43
#![allow(incomplete_features)]
54
#![feature(associated_type_defaults)]
65
#![allow(dead_code)]
@@ -73,7 +72,7 @@ pub trait BluetoothMeshDriver {
7372
Self: 'f,
7473
D: BluetoothMeshDevice + 'f;
7574

76-
fn run<'r, D: BluetoothMeshDevice>(&'r mut self, device: &'r mut D) -> Self::RunFuture<'_, D>;
75+
fn run<'r, D: BluetoothMeshDevice>(&'r mut self, device: &'r mut D) -> Self::RunFuture<'r, D>;
7776
}
7877

7978
pub struct Driver<N: NetworkInterfaces, R: RngCore + CryptoRng, B: BackingStore> {
@@ -853,7 +852,7 @@ impl<N: NetworkInterfaces, R: RngCore + CryptoRng, B: BackingStore> BluetoothMes
853852
Self: 'f,
854853
D: BluetoothMeshDevice + 'f;
855854

856-
fn run<'r, D: BluetoothMeshDevice>(&'r mut self, device: &'r mut D) -> Self::RunFuture<'_, D> {
855+
fn run<'r, D: BluetoothMeshDevice>(&'r mut self, device: &'r mut D) -> Self::RunFuture<'r, D> {
857856
async move {
858857
InnerDriver::new(
859858
unwrap!(self.network.take()),

btmesh-macro/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ prettyplease = "0.1.18"
2323
[dev-dependencies]
2424
btmesh-device = { path = "../btmesh-device" }
2525
btmesh-models = { path = "../btmesh-models" }
26-
embassy-time = { version = "0.1.3", default-features = false, features = [
26+
embassy-time = { version = "0.3.2", default-features = false, features = [
2727
"std",
2828
] }
29+
30+
[patch.crates-io]
31+
embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }

btmesh-models/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ serde = { version = "1.0", default-features = false, features = [
1212
], optional = true }
1313
defmt = { version = "0.3", optional = true }
1414
micromath = { version = "2.0" }
15-
heapless = "0.7"
15+
heapless = "0.8"
1616

1717
[features]
1818
relay = []

btmesh-nrf-softdevice/Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,30 @@ edition = "2021"
99
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1010

1111
[dependencies]
12+
embassy-sync = { version = "0.6.0" }
1213
btmesh-common = { path = "../btmesh-common", default-features = false }
1314
btmesh-pdu = { path = "../btmesh-pdu", default-features = false }
1415
btmesh-bearer = { path = "../btmesh-bearer", default-features = false }
1516
btmesh-driver = { path = "../btmesh-driver", default-features = false, features = [
1617
"flash",
1718
] }
1819
btmesh-device = { path = "../btmesh-device", default-features = false }
19-
heapless = "0.7"
20+
heapless = "0.8"
2021
atomic-polyfill = { version = "1", default-features = false }
2122
rand_core = { version = "0.6.2", default-features = false }
22-
embassy-sync = { version = "0.3.0", default-features = false, features = [
23-
"nightly",
24-
] }
2523
embassy-futures = { version = "0.1.0", default-features = false }
2624
nrf-softdevice = { version = "0.1.0", default-features = false, features = [
27-
"nightly",
2825
"ble-peripheral",
2926
"ble-gatt-server",
3027
] }
3128
nrf-softdevice-s140 = { version = "0.1.0", optional = true }
3229
nrf-softdevice-macro = { version = "0.1.0" }
33-
defmt = { version = "0.3", optional = true }
34-
embassy-nrf = { version = "0.1.0", default-features = false, features = [
30+
defmt = { version = "0.3.2", optional = true }
31+
embassy-nrf = { version = "0.2.0", default-features = false, features = [
3532
"time-driver-rtc1",
3633
"gpiote",
3734
], optional = true }
38-
embassy-time = { version = "0.1.3", default-features = false }
35+
embassy-time = { version = "0.3", default-features = false }
3936

4037
[features]
4138
default = ["nrf52840"]
@@ -70,7 +67,10 @@ friend = ["btmesh-common/friend"]
7067
low_power = ["btmesh-common/low_power"]
7168

7269
[patch.crates-io]
73-
embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "65ed19aae272d6d6320554446f9187ec2ef8bf39" }
74-
nrf-softdevice = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "3b08bda268d343e100932cbf0df7e007826fa3be" }
75-
nrf-softdevice-s140 = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "3b08bda268d343e100932cbf0df7e007826fa3be" }
76-
nrf-softdevice-macro = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "3b08bda268d343e100932cbf0df7e007826fa3be" }
70+
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
71+
embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
72+
embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
73+
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
74+
nrf-softdevice = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "d554940a57646328e1a0f913fe83e59e350019a1" }
75+
nrf-softdevice-s140 = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "d554940a57646328e1a0f913fe83e59e350019a1" }
76+
nrf-softdevice-macro = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "d554940a57646328e1a0f913fe83e59e350019a1" }

btmesh-nrf-softdevice/examples/microbit/basic/.cargo/config.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
22
# replace nRF82840_xxAA with your chip as listed in `probe-run --list-chips`
3-
runner = "probe-run --chip nRF52833_xxAA"
3+
runner = "probe-rs run --chip nRF52833_xxAA"
44

55
rustflags = [
66
# Code-size optimizations.
7-
"-Z", "trap-unreachable=no",
8-
"-C", "inline-threshold=5",
9-
"-C", "no-vectorize-loops",
10-
# "-Z", "print-type-sizes",
11-
"-Z", "emit-stack-sizes",
7+
"-Z",
8+
"trap-unreachable=no",
9+
"-C",
10+
"no-vectorize-loops",
11+
# "-Z", "print-type-sizes",
12+
"-Z",
13+
"emit-stack-sizes",
1214
]
1315

1416

btmesh-nrf-softdevice/examples/microbit/basic/Cargo.toml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,17 @@ defmt = { version = "0.3" }
1717
defmt-rtt = { version = "0.4" }
1818
panic-probe = { version = "0.3", features = ["print-defmt"] }
1919

20-
embassy-executor = { version = "0.3.0", default-features = false, features = [
20+
embassy-executor = { version = "0.6.3", default-features = false, features = [
2121
"arch-cortex-m",
2222
"executor-thread",
2323
"defmt",
2424
"integrated-timers",
25-
"nightly",
2625
] }
27-
embassy-time = { version = "0.1.3", default-features = false, features = [
26+
embassy-time = { version = "0.3.2", default-features = false, features = [
2827
"defmt",
2928
"defmt-timestamp-uptime",
3029
] }
31-
embassy-nrf = { version = "0.1.0", default-features = false, features = [
30+
embassy-nrf = { version = "0.2.0", default-features = false, features = [
3231
"rt",
3332
"nrf52833",
3433
"gpiote",
@@ -84,15 +83,11 @@ opt-level = 1
8483
overflow-checks = false
8584

8685
[patch.crates-io]
87-
embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "65ed19aae272d6d6320554446f9187ec2ef8bf39" }
88-
embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "65ed19aae272d6d6320554446f9187ec2ef8bf39" }
89-
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "65ed19aae272d6d6320554446f9187ec2ef8bf39" }
90-
embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "65ed19aae272d6d6320554446f9187ec2ef8bf39" }
91-
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "65ed19aae272d6d6320554446f9187ec2ef8bf39" }
92-
nrf-softdevice = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "3b08bda268d343e100932cbf0df7e007826fa3be" }
93-
nrf-softdevice-s140 = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "3b08bda268d343e100932cbf0df7e007826fa3be" }
94-
nrf-softdevice-macro = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "3b08bda268d343e100932cbf0df7e007826fa3be" }
95-
96-
#nrf-softdevice = { path = "../../../../../nrf-softdevice/nrf-softdevice" }
97-
#nrf-softdevice-s140 = { path = "../../../../../nrf-softdevice/nrf-softdevice-s140" }
98-
#nrf-softdevice-macro = { path = "../../../../../nrf-softdevice/nrf-softdevice-macro" }
86+
embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
87+
embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
88+
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
89+
embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
90+
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "1a1d5c4689a8b6c57ebb74e99fdea8df39adb037" }
91+
nrf-softdevice = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "d554940a57646328e1a0f913fe83e59e350019a1" }
92+
nrf-softdevice-s140 = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "d554940a57646328e1a0f913fe83e59e350019a1" }
93+
nrf-softdevice-macro = { git = "https://github.com/embassy-rs/nrf-softdevice/", rev = "d554940a57646328e1a0f913fe83e59e350019a1" }

btmesh-nrf-softdevice/examples/microbit/basic/src/device.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'d> ElementZero<'d> {
3535
}
3636

3737
struct MyOnOffServerHandler<'d> {
38-
led: Output<'d, AnyPin>,
38+
led: Output<'d>,
3939
}
4040

4141
impl<'d> MyOnOffServerHandler<'d> {
@@ -92,7 +92,7 @@ impl BluetoothMeshModel<GenericOnOffServer> for MyOnOffServerHandler<'_> {
9292
}
9393

9494
struct MyOnOffClientHandler<'d> {
95-
button: Input<'d, AnyPin>,
95+
button: Input<'d>,
9696
}
9797

9898
impl MyOnOffClientHandler<'_> {

btmesh-nrf-softdevice/examples/microbit/basic/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![no_main]
33
#![macro_use]
44
#![feature(type_alias_impl_trait)]
5-
#![feature(async_fn_in_trait)]
65
#![allow(incomplete_features)]
76

87
use embassy_executor::Spawner;

0 commit comments

Comments
 (0)