aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/flash/mod.rs
diff options
context:
space:
mode:
authorRasmus Melchior Jacobsen <[email protected]>2023-03-30 06:01:56 +0200
committerRasmus Melchior Jacobsen <[email protected]>2023-03-30 06:01:56 +0200
commite3c4e00be0469030f163568efa2902d73e2b8a4c (patch)
treef68958593139919b822c6c2835741b3349303e2d /embassy-stm32/src/flash/mod.rs
parent91d8afd371c20d21765713a45625f62ce25d97b6 (diff)
Align families
Diffstat (limited to 'embassy-stm32/src/flash/mod.rs')
-rw-r--r--embassy-stm32/src/flash/mod.rs44
1 files changed, 9 insertions, 35 deletions
diff --git a/embassy-stm32/src/flash/mod.rs b/embassy-stm32/src/flash/mod.rs
index 7dc714715..110b81496 100644
--- a/embassy-stm32/src/flash/mod.rs
+++ b/embassy-stm32/src/flash/mod.rs
@@ -24,9 +24,9 @@ pub struct FlashSector {
24 pub size: u32, 24 pub size: u32,
25} 25}
26 26
27impl Drop for FlashLayout<'_> { 27impl FlashRegion {
28 fn drop(&mut self) { 28 pub const fn end(&self) -> u32 {
29 unsafe { family::lock() }; 29 self.base + self.size
30 } 30 }
31} 31}
32 32
@@ -35,40 +35,14 @@ impl Drop for FlashLayout<'_> {
35#[cfg_attr(flash_f4, path = "f4.rs")] 35#[cfg_attr(flash_f4, path = "f4.rs")]
36#[cfg_attr(flash_f7, path = "f7.rs")] 36#[cfg_attr(flash_f7, path = "f7.rs")]
37#[cfg_attr(flash_h7, path = "h7.rs")] 37#[cfg_attr(flash_h7, path = "h7.rs")]
38#[cfg_attr(
39 not(any(
40 flash_l0, flash_l1, flash_l4, flash_wl, flash_wb, flash_f3, flash_f4, flash_f7, flash_h7
41 )),
42 path = "other.rs"
43)]
38mod family; 44mod family;
39 45
40#[cfg(not(any(
41 flash_l0, flash_l1, flash_l4, flash_wl, flash_wb, flash_f3, flash_f4, flash_f7, flash_h7
42)))]
43mod family {
44 use super::{Error, FlashSector, WRITE_SIZE};
45
46 pub(crate) unsafe fn lock() {
47 unimplemented!();
48 }
49 pub(crate) unsafe fn unlock() {
50 unimplemented!();
51 }
52 pub(crate) unsafe fn begin_write() {
53 unimplemented!();
54 }
55 pub(crate) unsafe fn end_write() {
56 unimplemented!();
57 }
58 pub(crate) unsafe fn blocking_write(_start_address: u32, _buf: &[u8; WRITE_SIZE]) -> Result<(), Error> {
59 unimplemented!();
60 }
61 pub(crate) unsafe fn blocking_erase_sector(_sector: &FlashSector) -> Result<(), Error> {
62 unimplemented!();
63 }
64 pub(crate) unsafe fn clear_all_err() {
65 unimplemented!();
66 }
67 pub(crate) fn get_sector(_address: u32) -> FlashSector {
68 unimplemented!();
69 }
70}
71
72#[allow(unused_imports)] 46#[allow(unused_imports)]
73pub use family::*; 47pub use family::*;
74 48