summaryrefslogtreecommitdiff
path: root/nrf-softdevice
diff options
context:
space:
mode:
authorUlf Lilleengen <ulf.lilleengen@gmail.com>2022-02-07 12:32:26 +0100
committerUlf Lilleengen <ulf.lilleengen@gmail.com>2022-02-07 12:32:26 +0100
commit8cb278bf8ea30d77d03ae73e3d163190e4f6d73f (patch)
treefe31ec0cd8afea8029ac5dc1a5436c5f7ce1a65a /nrf-softdevice
parenta7cb812c853ae53df606ced49f920f1ab6201288 (diff)
downloadnrf-softdevice-8cb278bf8ea30d77d03ae73e3d163190e4f6d73f.zip
Use newly released embedded-storage and embedded-storage-async
Diffstat (limited to 'nrf-softdevice')
-rw-r--r--nrf-softdevice/Cargo.toml4
-rw-r--r--nrf-softdevice/src/flash.rs7
2 files changed, 7 insertions, 4 deletions
diff --git a/nrf-softdevice/Cargo.toml b/nrf-softdevice/Cargo.toml
index 4d5cc94..a487865 100644
--- a/nrf-softdevice/Cargo.toml
+++ b/nrf-softdevice/Cargo.toml
@@ -41,8 +41,8 @@ cortex-m-rt = ">=0.6.15,<0.8"
heapless = "0.7.1"
fixed = "1.5.0"
futures = { version = "0.3.17", default-features = false }
-embedded-storage = { git = "https://github.com/embassy-rs/embedded-storage.git", branch = "embassy" }
-embedded-storage-async = { git = "https://github.com/embassy-rs/embedded-storage.git", branch = "embassy" }
+embedded-storage = "0.3.0"
+embedded-storage-async = "0.3.0"
nrf52805-pac = { version = "0.10.0", features = ["rt"], optional = true }
nrf52810-pac = { version = "0.10.0", features = ["rt"], optional = true }
diff --git a/nrf-softdevice/src/flash.rs b/nrf-softdevice/src/flash.rs
index 2558712..530b4ea 100644
--- a/nrf-softdevice/src/flash.rs
+++ b/nrf-softdevice/src/flash.rs
@@ -1,7 +1,7 @@
use core::future::Future;
use core::marker::PhantomData;
use core::sync::atomic::{AtomicBool, Ordering};
-use embedded_storage::nor_flash::{NorFlashError, NorFlashErrorKind};
+use embedded_storage::nor_flash::{ErrorType, NorFlashError, NorFlashErrorKind};
use embedded_storage_async::nor_flash::{AsyncNorFlash, AsyncReadNorFlash};
use crate::raw;
@@ -67,9 +67,12 @@ pub(crate) fn on_flash_error() {
SIGNAL.signal(Err(FlashError::Failed))
}
+impl ErrorType for Flash {
+ type Error = FlashError;
+}
+
impl AsyncReadNorFlash for Flash {
const READ_SIZE: usize = 1;
- type Error = FlashError;
type ReadFuture<'a> = impl Future<Output = Result<(), FlashError>> + 'a;
fn read<'a>(&'a mut self, address: u32, data: &'a mut [u8]) -> Self::ReadFuture<'a> {