From 8cb278bf8ea30d77d03ae73e3d163190e4f6d73f Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 7 Feb 2022 12:32:26 +0100 Subject: Use newly released embedded-storage and embedded-storage-async --- nrf-softdevice/Cargo.toml | 4 ++-- nrf-softdevice/src/flash.rs | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'nrf-softdevice') 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> + 'a; fn read<'a>(&'a mut self, address: u32, data: &'a mut [u8]) -> Self::ReadFuture<'a> { -- cgit v1.2.3