aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32
diff options
context:
space:
mode:
authorRasmus Melchior Jacobsen <[email protected]>2023-05-24 13:11:03 +0200
committerRasmus Melchior Jacobsen <[email protected]>2023-05-25 13:04:48 +0200
commit966f0abf48cc143fc33e17a5fc9e138cf82ab05f (patch)
tree1e544db251e450e16445f152acf7de2541c6728e /embassy-stm32
parent1329a387e060d60ee2833d2eed6393f5dfc84d1a (diff)
Run format with nightly
Diffstat (limited to 'embassy-stm32')
-rw-r--r--embassy-stm32/src/flash/common.rs4
-rw-r--r--embassy-stm32/src/flash/f4.rs14
2 files changed, 8 insertions, 10 deletions
diff --git a/embassy-stm32/src/flash/common.rs b/embassy-stm32/src/flash/common.rs
index 7cec5a3c9..e1fe7e9da 100644
--- a/embassy-stm32/src/flash/common.rs
+++ b/embassy-stm32/src/flash/common.rs
@@ -8,8 +8,7 @@ use embassy_sync::mutex::Mutex;
8use stm32_metapac::FLASH_BASE; 8use stm32_metapac::FLASH_BASE;
9 9
10use super::{ 10use super::{
11 family, Error, FlashLayout, FlashRegion, FLASH_SIZE, MAX_ERASE_SIZE, READ_SIZE, 11 family, Error, FlashBank, FlashLayout, FlashRegion, FlashSector, FLASH_SIZE, MAX_ERASE_SIZE, READ_SIZE, WRITE_SIZE,
12 WRITE_SIZE, FlashSector, FlashBank,
13}; 12};
14use crate::peripherals::FLASH; 13use crate::peripherals::FLASH;
15use crate::Peripheral; 14use crate::Peripheral;
@@ -162,7 +161,6 @@ pub(crate) fn ensure_sector_aligned(
162 Ok(()) 161 Ok(())
163} 162}
164 163
165
166impl embedded_storage::nor_flash::ErrorType for Flash<'_> { 164impl embedded_storage::nor_flash::ErrorType for Flash<'_> {
167 type Error = Error; 165 type Error = Error;
168} 166}
diff --git a/embassy-stm32/src/flash/f4.rs b/embassy-stm32/src/flash/f4.rs
index 0c008fd0d..084bbdc6e 100644
--- a/embassy-stm32/src/flash/f4.rs
+++ b/embassy-stm32/src/flash/f4.rs
@@ -2,26 +2,26 @@ use core::convert::TryInto;
2use core::ptr::write_volatile; 2use core::ptr::write_volatile;
3use core::sync::atomic::{fence, Ordering}; 3use core::sync::atomic::{fence, Ordering};
4 4
5#[cfg(feature = "nightly")]
6use embassy_sync::waitqueue::AtomicWaker;
7
5use super::{FlashRegion, FlashSector, FLASH_REGIONS, WRITE_SIZE}; 8use super::{FlashRegion, FlashSector, FLASH_REGIONS, WRITE_SIZE};
6use crate::flash::Error; 9use crate::flash::Error;
7use crate::pac; 10use crate::pac;
8 11
9#[cfg(feature = "nightly")]
10use embassy_sync::waitqueue::AtomicWaker;
11
12#[cfg(any(stm32f427, stm32f429, stm32f437, stm32f439, stm32f469, stm32f479))] 12#[cfg(any(stm32f427, stm32f429, stm32f437, stm32f439, stm32f469, stm32f479))]
13mod alt_regions { 13mod alt_regions {
14 use embassy_hal_common::PeripheralRef; 14 use embassy_hal_common::PeripheralRef;
15 use stm32_metapac::FLASH_SIZE; 15 use stm32_metapac::FLASH_SIZE;
16 16
17 use crate::_generated::flash_regions::{OTPRegion, BANK1_REGION1, BANK1_REGION2, BANK1_REGION3, OTP_REGION}; 17 use crate::_generated::flash_regions::{OTPRegion, BANK1_REGION1, BANK1_REGION2, BANK1_REGION3, OTP_REGION};
18 #[cfg(feature = "nightly")]
19 use crate::flash::asynch;
18 use crate::flash::{ 20 use crate::flash::{
19 common, Bank1Region1, Bank1Region2, BlockingFlashRegion, Error, Flash, FlashBank, FlashRegion, 21 common, Bank1Region1, Bank1Region2, BlockingFlashRegion, Error, Flash, FlashBank, FlashRegion, READ_SIZE,
20 READ_SIZE, REGION_ACCESS, 22 REGION_ACCESS,
21 }; 23 };
22 use crate::peripherals::FLASH; 24 use crate::peripherals::FLASH;
23 #[cfg(feature = "nightly")]
24 use crate::flash::asynch;
25 25
26 pub const ALT_BANK1_REGION3: FlashRegion = FlashRegion { 26 pub const ALT_BANK1_REGION3: FlashRegion = FlashRegion {
27 size: 3 * BANK1_REGION3.erase_size, 27 size: 3 * BANK1_REGION3.erase_size,