aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/flash/l.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-stm32/src/flash/l.rs')
-rw-r--r--embassy-stm32/src/flash/l.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/embassy-stm32/src/flash/l.rs b/embassy-stm32/src/flash/l.rs
index 1b82704ec..cd23cda5c 100644
--- a/embassy-stm32/src/flash/l.rs
+++ b/embassy-stm32/src/flash/l.rs
@@ -1,5 +1,5 @@
1use core::ptr::write_volatile; 1use core::ptr::write_volatile;
2use core::sync::atomic::{fence, Ordering}; 2use core::sync::atomic::{Ordering, fence};
3 3
4use super::{FlashSector, WRITE_SIZE}; 4use super::{FlashSector, WRITE_SIZE};
5use crate::flash::Error; 5use crate::flash::Error;
@@ -234,19 +234,27 @@ pub(crate) unsafe fn wait_ready_blocking() -> Result<(), Error> {
234#[cfg(all(bank_setup_configurable, flash_l5))] 234#[cfg(all(bank_setup_configurable, flash_l5))]
235pub(crate) fn check_bank_setup() { 235pub(crate) fn check_bank_setup() {
236 if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dbank() { 236 if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dbank() {
237 panic!("Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use dual-bank config"); 237 panic!(
238 "Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use dual-bank config"
239 );
238 } 240 }
239 if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dbank() { 241 if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dbank() {
240 panic!("Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use single-bank config"); 242 panic!(
243 "Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use single-bank config"
244 );
241 } 245 }
242} 246}
243 247
244#[cfg(all(bank_setup_configurable, flash_l4))] 248#[cfg(all(bank_setup_configurable, flash_l4))]
245pub(crate) fn check_bank_setup() { 249pub(crate) fn check_bank_setup() {
246 if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dualbank() { 250 if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dualbank() {
247 panic!("Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dualbank value in the user option bytes or configure embassy to use dual-bank config"); 251 panic!(
252 "Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dualbank value in the user option bytes or configure embassy to use dual-bank config"
253 );
248 } 254 }
249 if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dualbank() { 255 if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dualbank() {
250 panic!("Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dualbank value in the user option bytes or configure embassy to use single-bank config"); 256 panic!(
257 "Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dualbank value in the user option bytes or configure embassy to use single-bank config"
258 );
251 } 259 }
252} 260}