aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-boot/boot/src/firmware_updater/asynch.rs8
-rw-r--r--embassy-boot/boot/src/firmware_updater/blocking.rs12
2 files changed, 10 insertions, 10 deletions
diff --git a/embassy-boot/boot/src/firmware_updater/asynch.rs b/embassy-boot/boot/src/firmware_updater/asynch.rs
index d0780bdf1..0b3f88313 100644
--- a/embassy-boot/boot/src/firmware_updater/asynch.rs
+++ b/embassy-boot/boot/src/firmware_updater/asynch.rs
@@ -1,5 +1,7 @@
1use digest::Digest; 1use digest::Digest;
2#[cfg(target_os = "none")]
2use embassy_embedded_hal::flash::partition::Partition; 3use embassy_embedded_hal::flash::partition::Partition;
4#[cfg(target_os = "none")]
3use embassy_sync::blocking_mutex::raw::NoopRawMutex; 5use embassy_sync::blocking_mutex::raw::NoopRawMutex;
4use embedded_storage_async::nor_flash::NorFlash; 6use embedded_storage_async::nor_flash::NorFlash;
5 7
@@ -13,14 +15,12 @@ pub struct FirmwareUpdater<DFU: NorFlash, STATE: NorFlash> {
13 state: STATE, 15 state: STATE,
14} 16}
15 17
18#[cfg(target_os = "none")]
16impl<'a, FLASH: NorFlash> 19impl<'a, FLASH: NorFlash>
17 FirmwareUpdaterConfig<Partition<'a, NoopRawMutex, FLASH>, Partition<'a, NoopRawMutex, FLASH>> 20 FirmwareUpdaterConfig<Partition<'a, NoopRawMutex, FLASH>, Partition<'a, NoopRawMutex, FLASH>>
18{ 21{
19 /// Create a firmware updater config from the flash and address symbols defined in the linkerfile 22 /// Create a firmware updater config from the flash and address symbols defined in the linkerfile
20 #[cfg(target_os = "none")] 23 pub fn from_linkerfile(flash: &'a embassy_sync::mutex::Mutex<NoopRawMutex, FLASH>) -> Self {
21 pub fn from_linkerfile(flash: &'a Mutex<NoopRawMutex, FLASH>) -> Self {
22 use embassy_sync::mutex::Mutex;
23
24 extern "C" { 24 extern "C" {
25 static __bootloader_state_start: u32; 25 static __bootloader_state_start: u32;
26 static __bootloader_state_end: u32; 26 static __bootloader_state_end: u32;
diff --git a/embassy-boot/boot/src/firmware_updater/blocking.rs b/embassy-boot/boot/src/firmware_updater/blocking.rs
index c44126149..551150c4f 100644
--- a/embassy-boot/boot/src/firmware_updater/blocking.rs
+++ b/embassy-boot/boot/src/firmware_updater/blocking.rs
@@ -1,5 +1,7 @@
1use digest::Digest; 1use digest::Digest;
2#[cfg(target_os = "none")]
2use embassy_embedded_hal::flash::partition::BlockingPartition; 3use embassy_embedded_hal::flash::partition::BlockingPartition;
4#[cfg(target_os = "none")]
3use embassy_sync::blocking_mutex::raw::NoopRawMutex; 5use embassy_sync::blocking_mutex::raw::NoopRawMutex;
4use embedded_storage::nor_flash::NorFlash; 6use embedded_storage::nor_flash::NorFlash;
5 7
@@ -13,16 +15,14 @@ pub struct BlockingFirmwareUpdater<DFU: NorFlash, STATE: NorFlash> {
13 state: STATE, 15 state: STATE,
14} 16}
15 17
18#[cfg(target_os = "none")]
16impl<'a, FLASH: NorFlash> 19impl<'a, FLASH: NorFlash>
17 FirmwareUpdaterConfig<BlockingPartition<'a, NoopRawMutex, FLASH>, BlockingPartition<'a, NoopRawMutex, FLASH>> 20 FirmwareUpdaterConfig<BlockingPartition<'a, NoopRawMutex, FLASH>, BlockingPartition<'a, NoopRawMutex, FLASH>>
18{ 21{
19 /// Create a firmware updater config from the flash and address symbols defined in the linkerfile 22 /// Create a firmware updater config from the flash and address symbols defined in the linkerfile
20 #[cfg(target_os = "none")] 23 pub fn from_linkerfile_blocking(
21 pub fn from_linkerfile_blocking(flash: &'a Mutex<NoopRawMutex, RefCell<FLASH>>) -> Self { 24 flash: &'a embassy_sync::blocking_mutex::Mutex<NoopRawMutex, core::cell::RefCell<FLASH>>,
22 use core::cell::RefCell; 25 ) -> Self {
23
24 use embassy_sync::blocking_mutex::Mutex;
25
26 extern "C" { 26 extern "C" {
27 static __bootloader_state_start: u32; 27 static __bootloader_state_start: u32;
28 static __bootloader_state_end: u32; 28 static __bootloader_state_end: u32;