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 --- Cargo.lock | 18 ++++++++++-------- examples/Cargo.toml | 4 ++-- nrf-softdevice/Cargo.toml | 4 ++-- nrf-softdevice/src/flash.rs | 7 +++++-- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96a11a8..7df7df0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ "embassy-macros", "embedded-dma", "embedded-hal 0.2.6", - "embedded-storage 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "embedded-storage 0.2.0", "fixed", "futures", "nrf-usbd", @@ -400,15 +400,17 @@ checksum = "723dce4e9f25b6e6c5f35628e144794e5b459216ed7da97b7c4b66cdb3fa82ca" [[package]] name = "embedded-storage" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embedded-storage.git?branch=embassy#de0c533dfdd2ce1c59083c85185c101b0c26e764" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "156d7a2fdd98ebbf9ae579cbceca3058cff946e13f8e17b90e3511db0508c723" [[package]] name = "embedded-storage-async" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embedded-storage.git?branch=embassy#de0c533dfdd2ce1c59083c85185c101b0c26e764" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ff04af74e47e9bb4315bd7aa2b01f3d1b05f33c03a6c4e9c3b20e9ce9cd8d79" dependencies = [ - "embedded-storage 0.2.0 (git+https://github.com/embassy-rs/embedded-storage.git?branch=embassy)", + "embedded-storage 0.3.0", ] [[package]] @@ -611,7 +613,7 @@ dependencies = [ "critical-section", "defmt", "embassy", - "embedded-storage 0.2.0 (git+https://github.com/embassy-rs/embedded-storage.git?branch=embassy)", + "embedded-storage 0.3.0", "embedded-storage-async", "fixed", "futures", @@ -654,7 +656,7 @@ dependencies = [ "embassy", "embassy-nrf", "embassy-traits", - "embedded-storage 0.2.0 (git+https://github.com/embassy-rs/embedded-storage.git?branch=embassy)", + "embedded-storage 0.3.0", "embedded-storage-async", "fixed", "futures", diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 4d56e3c..ea91e02 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -26,8 +26,8 @@ nrf-softdevice-defmt-rtt = { path = "../nrf-softdevice-defmt-rtt", version = "0. panic-probe = { version = "0.3", 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 = { 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" futures = { version = "0.3.5", default-features = false } fixed = "1.2.0" heapless = "0.7.1" 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