From c22d2b5b5bbc5e3c7d3a039e90b50d39809a10f2 Mon Sep 17 00:00:00 2001 From: Rasmus Melchior Jacobsen Date: Tue, 30 May 2023 14:13:53 +0200 Subject: [PATCH] Remove unused use's --- embassy-boot/boot/src/firmware_updater/asynch.rs | 8 ++++---- embassy-boot/boot/src/firmware_updater/blocking.rs | 12 ++++++------ 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 @@ use digest::Digest; +#[cfg(target_os = "none")] use embassy_embedded_hal::flash::partition::Partition; +#[cfg(target_os = "none")] use embassy_sync::blocking_mutex::raw::NoopRawMutex; use embedded_storage_async::nor_flash::NorFlash; @@ -13,14 +15,12 @@ pub struct FirmwareUpdater { state: STATE, } +#[cfg(target_os = "none")] impl<'a, FLASH: NorFlash> FirmwareUpdaterConfig, Partition<'a, NoopRawMutex, FLASH>> { /// Create a firmware updater config from the flash and address symbols defined in the linkerfile - #[cfg(target_os = "none")] - pub fn from_linkerfile(flash: &'a Mutex) -> Self { - use embassy_sync::mutex::Mutex; - + pub fn from_linkerfile(flash: &'a embassy_sync::mutex::Mutex) -> Self { extern "C" { static __bootloader_state_start: u32; 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 @@ use digest::Digest; +#[cfg(target_os = "none")] use embassy_embedded_hal::flash::partition::BlockingPartition; +#[cfg(target_os = "none")] use embassy_sync::blocking_mutex::raw::NoopRawMutex; use embedded_storage::nor_flash::NorFlash; @@ -13,16 +15,14 @@ pub struct BlockingFirmwareUpdater { state: STATE, } +#[cfg(target_os = "none")] impl<'a, FLASH: NorFlash> FirmwareUpdaterConfig, BlockingPartition<'a, NoopRawMutex, FLASH>> { /// Create a firmware updater config from the flash and address symbols defined in the linkerfile - #[cfg(target_os = "none")] - pub fn from_linkerfile_blocking(flash: &'a Mutex>) -> Self { - use core::cell::RefCell; - - use embassy_sync::blocking_mutex::Mutex; - + pub fn from_linkerfile_blocking( + flash: &'a embassy_sync::blocking_mutex::Mutex>, + ) -> Self { extern "C" { static __bootloader_state_start: u32; static __bootloader_state_end: u32;