diff options
| -rw-r--r-- | embassy-boot/boot/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-boot/boot/src/lib.rs | 4 | ||||
| -rw-r--r-- | embassy-boot/nrf/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-boot/rp/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-boot/stm32/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-embedded-hal/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-embedded-hal/src/adapter.rs | 19 | ||||
| -rw-r--r-- | embassy-nrf/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/qspi.rs | 24 | ||||
| -rw-r--r-- | examples/boot/bootloader/rp/Cargo.toml | 2 | ||||
| -rw-r--r-- | examples/boot/bootloader/stm32/Cargo.toml | 2 |
11 files changed, 26 insertions, 37 deletions
diff --git a/embassy-boot/boot/Cargo.toml b/embassy-boot/boot/Cargo.toml index 0b0c77b1e..3312c2f9f 100644 --- a/embassy-boot/boot/Cargo.toml +++ b/embassy-boot/boot/Cargo.toml | |||
| @@ -28,7 +28,7 @@ log = { version = "0.4", optional = true } | |||
| 28 | ed25519-dalek = { version = "1.0.1", default_features = false, features = ["u32_backend"], optional = true } | 28 | ed25519-dalek = { version = "1.0.1", default_features = false, features = ["u32_backend"], optional = true } |
| 29 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync" } | 29 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync" } |
| 30 | embedded-storage = "0.3.0" | 30 | embedded-storage = "0.3.0" |
| 31 | embedded-storage-async = "0.3.0" | 31 | embedded-storage-async = "0.4.0" |
| 32 | salty = { git = "https://github.com/ycrypto/salty.git", rev = "a9f17911a5024698406b75c0fac56ab5ccf6a8c7", optional = true } | 32 | salty = { git = "https://github.com/ycrypto/salty.git", rev = "a9f17911a5024698406b75c0fac56ab5ccf6a8c7", optional = true } |
| 33 | signature = { version = "1.6.4", default-features = false } | 33 | signature = { version = "1.6.4", default-features = false } |
| 34 | 34 | ||
diff --git a/embassy-boot/boot/src/lib.rs b/embassy-boot/boot/src/lib.rs index be254e9d7..b5dad5046 100644 --- a/embassy-boot/boot/src/lib.rs +++ b/embassy-boot/boot/src/lib.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | mod fmt; | 5 | mod fmt; |
| 6 | 6 | ||
| 7 | use embedded_storage::nor_flash::{ErrorType, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash}; | 7 | use embedded_storage::nor_flash::{ErrorType, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash}; |
| 8 | use embedded_storage_async::nor_flash::AsyncNorFlash; | 8 | use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; |
| 9 | 9 | ||
| 10 | const BOOT_MAGIC: u8 = 0xD0; | 10 | const BOOT_MAGIC: u8 = 0xD0; |
| 11 | const SWAP_MAGIC: u8 = 0xF0; | 11 | const SWAP_MAGIC: u8 = 0xF0; |
| @@ -1199,7 +1199,7 @@ mod tests { | |||
| 1199 | use core::future::Future; | 1199 | use core::future::Future; |
| 1200 | 1200 | ||
| 1201 | use embedded_storage::nor_flash::ErrorType; | 1201 | use embedded_storage::nor_flash::ErrorType; |
| 1202 | use embedded_storage_async::nor_flash::AsyncReadNorFlash; | 1202 | use embedded_storage_async::nor_flash::ReadNorFlash as AsyncReadNorFlash; |
| 1203 | use futures::executor::block_on; | 1203 | use futures::executor::block_on; |
| 1204 | 1204 | ||
| 1205 | use super::*; | 1205 | use super::*; |
diff --git a/embassy-boot/nrf/Cargo.toml b/embassy-boot/nrf/Cargo.toml index c6af70144..c1a127518 100644 --- a/embassy-boot/nrf/Cargo.toml +++ b/embassy-boot/nrf/Cargo.toml | |||
| @@ -22,7 +22,7 @@ embassy-boot = { path = "../boot", default-features = false } | |||
| 22 | cortex-m = { version = "0.7.6" } | 22 | cortex-m = { version = "0.7.6" } |
| 23 | cortex-m-rt = { version = "0.7" } | 23 | cortex-m-rt = { version = "0.7" } |
| 24 | embedded-storage = "0.3.0" | 24 | embedded-storage = "0.3.0" |
| 25 | embedded-storage-async = "0.3.0" | 25 | embedded-storage-async = "0.4.0" |
| 26 | cfg-if = "1.0.0" | 26 | cfg-if = "1.0.0" |
| 27 | 27 | ||
| 28 | nrf-softdevice-mbr = { version = "0.1.0", git = "https://github.com/embassy-rs/nrf-softdevice.git", branch = "master", optional = true } | 28 | nrf-softdevice-mbr = { version = "0.1.0", git = "https://github.com/embassy-rs/nrf-softdevice.git", branch = "master", optional = true } |
diff --git a/embassy-boot/rp/Cargo.toml b/embassy-boot/rp/Cargo.toml index ffc36a4e0..96024cdda 100644 --- a/embassy-boot/rp/Cargo.toml +++ b/embassy-boot/rp/Cargo.toml | |||
| @@ -25,7 +25,7 @@ embassy-time = { path = "../../embassy-time", features = ["nightly"] } | |||
| 25 | cortex-m = { version = "0.7.6" } | 25 | cortex-m = { version = "0.7.6" } |
| 26 | cortex-m-rt = { version = "0.7" } | 26 | cortex-m-rt = { version = "0.7" } |
| 27 | embedded-storage = "0.3.0" | 27 | embedded-storage = "0.3.0" |
| 28 | embedded-storage-async = "0.3.0" | 28 | embedded-storage-async = "0.4.0" |
| 29 | cfg-if = "1.0.0" | 29 | cfg-if = "1.0.0" |
| 30 | 30 | ||
| 31 | [features] | 31 | [features] |
diff --git a/embassy-boot/stm32/Cargo.toml b/embassy-boot/stm32/Cargo.toml index 2fc169b32..7061063bb 100644 --- a/embassy-boot/stm32/Cargo.toml +++ b/embassy-boot/stm32/Cargo.toml | |||
| @@ -24,7 +24,7 @@ embassy-boot = { path = "../boot", default-features = false } | |||
| 24 | cortex-m = { version = "0.7.6" } | 24 | cortex-m = { version = "0.7.6" } |
| 25 | cortex-m-rt = { version = "0.7" } | 25 | cortex-m-rt = { version = "0.7" } |
| 26 | embedded-storage = "0.3.0" | 26 | embedded-storage = "0.3.0" |
| 27 | embedded-storage-async = "0.3.0" | 27 | embedded-storage-async = "0.4.0" |
| 28 | cfg-if = "1.0.0" | 28 | cfg-if = "1.0.0" |
| 29 | 29 | ||
| 30 | [features] | 30 | [features] |
diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml index fa74be8c4..45eb0d43d 100644 --- a/embassy-embedded-hal/Cargo.toml +++ b/embassy-embedded-hal/Cargo.toml | |||
| @@ -22,7 +22,7 @@ embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["un | |||
| 22 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" } | 22 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" } |
| 23 | embedded-hal-async = { version = "=0.2.0-alpha.0", optional = true } | 23 | embedded-hal-async = { version = "=0.2.0-alpha.0", optional = true } |
| 24 | embedded-storage = "0.3.0" | 24 | embedded-storage = "0.3.0" |
| 25 | embedded-storage-async = { version = "0.3.0", optional = true } | 25 | embedded-storage-async = { version = "0.4.0", optional = true } |
| 26 | nb = "1.0.0" | 26 | nb = "1.0.0" |
| 27 | 27 | ||
| 28 | defmt = { version = "0.3", optional = true } | 28 | defmt = { version = "0.3", optional = true } |
diff --git a/embassy-embedded-hal/src/adapter.rs b/embassy-embedded-hal/src/adapter.rs index 3680984f1..a49f8df4b 100644 --- a/embassy-embedded-hal/src/adapter.rs +++ b/embassy-embedded-hal/src/adapter.rs | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | //! Adapters between embedded-hal traits. | 1 | //! Adapters between embedded-hal traits. |
| 2 | 2 | ||
| 3 | use core::future::Future; | ||
| 4 | |||
| 5 | use embedded_hal_02::{blocking, serial}; | 3 | use embedded_hal_02::{blocking, serial}; |
| 6 | 4 | ||
| 7 | /// Wrapper that implements async traits using blocking implementations. | 5 | /// Wrapper that implements async traits using blocking implementations. |
| @@ -182,7 +180,7 @@ where | |||
| 182 | 180 | ||
| 183 | /// NOR flash wrapper | 181 | /// NOR flash wrapper |
| 184 | use embedded_storage::nor_flash::{ErrorType, NorFlash, ReadNorFlash}; | 182 | use embedded_storage::nor_flash::{ErrorType, NorFlash, ReadNorFlash}; |
| 185 | use embedded_storage_async::nor_flash::{AsyncNorFlash, AsyncReadNorFlash}; | 183 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; |
| 186 | 184 | ||
| 187 | impl<T> ErrorType for BlockingAsync<T> | 185 | impl<T> ErrorType for BlockingAsync<T> |
| 188 | where | 186 | where |
| @@ -198,14 +196,12 @@ where | |||
| 198 | const WRITE_SIZE: usize = <T as NorFlash>::WRITE_SIZE; | 196 | const WRITE_SIZE: usize = <T as NorFlash>::WRITE_SIZE; |
| 199 | const ERASE_SIZE: usize = <T as NorFlash>::ERASE_SIZE; | 197 | const ERASE_SIZE: usize = <T as NorFlash>::ERASE_SIZE; |
| 200 | 198 | ||
| 201 | type WriteFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | 199 | async fn write(&mut self, offset: u32, data: &[u8]) -> Result<(), Self::Error> { |
| 202 | fn write<'a>(&'a mut self, offset: u32, data: &'a [u8]) -> Self::WriteFuture<'a> { | 200 | self.wrapped.write(offset, data) |
| 203 | async move { self.wrapped.write(offset, data) } | ||
| 204 | } | 201 | } |
| 205 | 202 | ||
| 206 | type EraseFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | 203 | async fn erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error> { |
| 207 | fn erase<'a>(&'a mut self, from: u32, to: u32) -> Self::EraseFuture<'a> { | 204 | self.wrapped.erase(from, to) |
| 208 | async move { self.wrapped.erase(from, to) } | ||
| 209 | } | 205 | } |
| 210 | } | 206 | } |
| 211 | 207 | ||
| @@ -214,9 +210,8 @@ where | |||
| 214 | T: ReadNorFlash, | 210 | T: ReadNorFlash, |
| 215 | { | 211 | { |
| 216 | const READ_SIZE: usize = <T as ReadNorFlash>::READ_SIZE; | 212 | const READ_SIZE: usize = <T as ReadNorFlash>::READ_SIZE; |
| 217 | type ReadFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | 213 | async fn read(&mut self, address: u32, data: &mut [u8]) -> Result<(), Self::Error> { |
| 218 | fn read<'a>(&'a mut self, address: u32, data: &'a mut [u8]) -> Self::ReadFuture<'a> { | 214 | self.wrapped.read(address, data) |
| 219 | async move { self.wrapped.read(address, data) } | ||
| 220 | } | 215 | } |
| 221 | 216 | ||
| 222 | fn capacity(&self) -> usize { | 217 | fn capacity(&self) -> usize { |
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index c31ce199b..4e62ca89e 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml | |||
| @@ -100,7 +100,7 @@ critical-section = "1.1" | |||
| 100 | rand_core = "0.6.3" | 100 | rand_core = "0.6.3" |
| 101 | fixed = "1.10.0" | 101 | fixed = "1.10.0" |
| 102 | embedded-storage = "0.3.0" | 102 | embedded-storage = "0.3.0" |
| 103 | embedded-storage-async = { version = "0.3.0", optional = true } | 103 | embedded-storage-async = { version = "0.4.0", optional = true } |
| 104 | cfg-if = "1.0.0" | 104 | cfg-if = "1.0.0" |
| 105 | 105 | ||
| 106 | nrf52805-pac = { version = "0.12.0", optional = true, features = [ "rt" ] } | 106 | nrf52805-pac = { version = "0.12.0", optional = true, features = [ "rt" ] } |
diff --git a/embassy-nrf/src/qspi.rs b/embassy-nrf/src/qspi.rs index d434327fc..1b379002b 100644 --- a/embassy-nrf/src/qspi.rs +++ b/embassy-nrf/src/qspi.rs | |||
| @@ -528,34 +528,28 @@ impl<'d, T: Instance, const FLASH_SIZE: usize> NorFlash for Qspi<'d, T, FLASH_SI | |||
| 528 | cfg_if::cfg_if! { | 528 | cfg_if::cfg_if! { |
| 529 | if #[cfg(feature = "nightly")] | 529 | if #[cfg(feature = "nightly")] |
| 530 | { | 530 | { |
| 531 | use embedded_storage_async::nor_flash::{AsyncNorFlash, AsyncReadNorFlash}; | 531 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; |
| 532 | use core::future::Future; | ||
| 533 | 532 | ||
| 534 | impl<'d, T: Instance, const FLASH_SIZE: usize> AsyncNorFlash for Qspi<'d, T, FLASH_SIZE> { | 533 | impl<'d, T: Instance, const FLASH_SIZE: usize> AsyncNorFlash for Qspi<'d, T, FLASH_SIZE> { |
| 535 | const WRITE_SIZE: usize = <Self as NorFlash>::WRITE_SIZE; | 534 | const WRITE_SIZE: usize = <Self as NorFlash>::WRITE_SIZE; |
| 536 | const ERASE_SIZE: usize = <Self as NorFlash>::ERASE_SIZE; | 535 | const ERASE_SIZE: usize = <Self as NorFlash>::ERASE_SIZE; |
| 537 | 536 | ||
| 538 | type WriteFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | 537 | async fn write(&mut self, offset: u32, data: &[u8]) -> Result<(), Self::Error> { |
| 539 | fn write<'a>(&'a mut self, offset: u32, data: &'a [u8]) -> Self::WriteFuture<'a> { | 538 | self.write(offset as usize, data).await |
| 540 | async move { self.write(offset as usize, data).await } | ||
| 541 | } | 539 | } |
| 542 | 540 | ||
| 543 | type EraseFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | 541 | async fn erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error> { |
| 544 | fn erase<'a>(&'a mut self, from: u32, to: u32) -> Self::EraseFuture<'a> { | 542 | for address in (from as usize..to as usize).step_by(<Self as AsyncNorFlash>::ERASE_SIZE) { |
| 545 | async move { | 543 | self.erase(address).await? |
| 546 | for address in (from as usize..to as usize).step_by(<Self as AsyncNorFlash>::ERASE_SIZE) { | ||
| 547 | self.erase(address).await? | ||
| 548 | } | ||
| 549 | Ok(()) | ||
| 550 | } | 544 | } |
| 545 | Ok(()) | ||
| 551 | } | 546 | } |
| 552 | } | 547 | } |
| 553 | 548 | ||
| 554 | impl<'d, T: Instance, const FLASH_SIZE: usize> AsyncReadNorFlash for Qspi<'d, T, FLASH_SIZE> { | 549 | impl<'d, T: Instance, const FLASH_SIZE: usize> AsyncReadNorFlash for Qspi<'d, T, FLASH_SIZE> { |
| 555 | const READ_SIZE: usize = 4; | 550 | const READ_SIZE: usize = 4; |
| 556 | type ReadFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | 551 | async fn read(&mut self, address: u32, data: &mut [u8]) -> Result<(), Self::Error> { |
| 557 | fn read<'a>(&'a mut self, address: u32, data: &'a mut [u8]) -> Self::ReadFuture<'a> { | 552 | self.read(address as usize, data).await |
| 558 | async move { self.read(address as usize, data).await } | ||
| 559 | } | 553 | } |
| 560 | 554 | ||
| 561 | fn capacity(&self) -> usize { | 555 | fn capacity(&self) -> usize { |
diff --git a/examples/boot/bootloader/rp/Cargo.toml b/examples/boot/bootloader/rp/Cargo.toml index c0b576cff..a16cebe31 100644 --- a/examples/boot/bootloader/rp/Cargo.toml +++ b/examples/boot/bootloader/rp/Cargo.toml | |||
| @@ -16,7 +16,7 @@ embassy-time = { path = "../../../../embassy-time", features = ["nightly"] } | |||
| 16 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } | 16 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } |
| 17 | cortex-m-rt = { version = "0.7" } | 17 | cortex-m-rt = { version = "0.7" } |
| 18 | embedded-storage = "0.3.0" | 18 | embedded-storage = "0.3.0" |
| 19 | embedded-storage-async = "0.3.0" | 19 | embedded-storage-async = "0.4.0" |
| 20 | cfg-if = "1.0.0" | 20 | cfg-if = "1.0.0" |
| 21 | 21 | ||
| 22 | [features] | 22 | [features] |
diff --git a/examples/boot/bootloader/stm32/Cargo.toml b/examples/boot/bootloader/stm32/Cargo.toml index be659e02a..b1791620f 100644 --- a/examples/boot/bootloader/stm32/Cargo.toml +++ b/examples/boot/bootloader/stm32/Cargo.toml | |||
| @@ -14,7 +14,7 @@ embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32", default-features | |||
| 14 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } | 14 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } |
| 15 | cortex-m-rt = { version = "0.7" } | 15 | cortex-m-rt = { version = "0.7" } |
| 16 | embedded-storage = "0.3.0" | 16 | embedded-storage = "0.3.0" |
| 17 | embedded-storage-async = "0.3.0" | 17 | embedded-storage-async = "0.4.0" |
| 18 | cfg-if = "1.0.0" | 18 | cfg-if = "1.0.0" |
| 19 | 19 | ||
| 20 | [features] | 20 | [features] |
