From d81925996e22f776376db7181b73536832088a36 Mon Sep 17 00:00:00 2001 From: Mathias Koch Date: Tue, 11 Jun 2024 10:16:42 +0200 Subject: [PATCH] Bump embassy-sync to 0.6 (#206) --- atat/Cargo.toml | 2 +- atat/src/ingress.rs | 6 +++--- atat/src/urc_channel.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/atat/Cargo.toml b/atat/Cargo.toml index 3aefa3c..a013e4d 100644 --- a/atat/Cargo.toml +++ b/atat/Cargo.toml @@ -21,7 +21,7 @@ name = "atat" embedded-io = "0.6.0" embedded-io-async = "0.6.0" futures = { version = "0.3", default-features = false } -embassy-sync = "0.5" +embassy-sync = "0.6" embassy-time = "0.3" heapless = { version = "^0.8", features = ["serde"] } serde_at = { path = "../serde_at", version = "^0.22.0", optional = true } diff --git a/atat/src/ingress.rs b/atat/src/ingress.rs index 9fbd591..b99ca54 100644 --- a/atat/src/ingress.rs +++ b/atat/src/ingress.rs @@ -54,7 +54,7 @@ pub trait AtatIngress { /// Read all bytes from the provided serial and ingest the read bytes into /// the ingress from where they will be processed - async fn read_from(&mut self, serial: &mut impl embedded_io_async::Read) -> ! { + async fn read_from(&mut self, mut serial: R) -> ! { use embedded_io::Error; loop { let buf = self.write_buf(); @@ -158,7 +158,7 @@ impl< if let Some(urc) = Urc::parse(urc_line) { debug!( "Received URC/{} ({}/{}): {:?}", - self.urc_publisher.space(), + self.urc_publisher.free_capacity(), swallowed, self.pos, LossyStr(urc_line) @@ -242,7 +242,7 @@ impl< if let Some(urc) = Urc::parse(urc_line) { debug!( "Received URC/{} ({}/{}): {:?}", - self.urc_publisher.space(), + self.urc_publisher.free_capacity(), swallowed, self.pos, LossyStr(urc_line) diff --git a/atat/src/urc_channel.rs b/atat/src/urc_channel.rs index b51c3b5..478cc40 100644 --- a/atat/src/urc_channel.rs +++ b/atat/src/urc_channel.rs @@ -1,5 +1,5 @@ use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; -use embassy_sync::pubsub::{PubSubBehavior, PubSubChannel, Publisher, Subscriber}; +use embassy_sync::pubsub::{PubSubChannel, Publisher, Subscriber}; use crate::AtatUrc; @@ -31,7 +31,7 @@ impl .map_err(|_| Error::MaximumSubscribersReached) } - pub fn space(&self) -> usize { - self.0.space() + pub fn free_capacity(&self) -> usize { + self.0.free_capacity() } }