diff options
| author | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-24 23:51:48 +0200 |
|---|---|---|
| committer | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-25 13:04:48 +0200 |
| commit | e65ff85b88deef3e32cc437d28e36274b82ce03e (patch) | |
| tree | cc2fee0c6d1cbeaaf40ac2a6252c28d46d85f222 /embassy-stm32 | |
| parent | 9370973846310d013f5be586a4e37031fcb21a16 (diff) | |
Default to Async mode
Diffstat (limited to 'embassy-stm32')
| -rw-r--r-- | embassy-stm32/build.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/flash/f4.rs | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/embassy-stm32/build.rs b/embassy-stm32/build.rs index 29af3c80d..b766f0739 100644 --- a/embassy-stm32/build.rs +++ b/embassy-stm32/build.rs | |||
| @@ -213,7 +213,7 @@ fn main() { | |||
| 213 | let region_type = format_ident!("{}", get_flash_region_type_name(region.name)); | 213 | let region_type = format_ident!("{}", get_flash_region_type_name(region.name)); |
| 214 | flash_regions.extend(quote! { | 214 | flash_regions.extend(quote! { |
| 215 | #[cfg(flash)] | 215 | #[cfg(flash)] |
| 216 | pub struct #region_type<'d, MODE>(pub &'static crate::flash::FlashRegion, pub(crate) embassy_hal_common::PeripheralRef<'d, crate::peripherals::FLASH>, pub(crate) core::marker::PhantomData<MODE>); | 216 | pub struct #region_type<'d, MODE = crate::flash::Async>(pub &'static crate::flash::FlashRegion, pub(crate) embassy_hal_common::PeripheralRef<'d, crate::peripherals::FLASH>, pub(crate) core::marker::PhantomData<MODE>); |
| 217 | }); | 217 | }); |
| 218 | } | 218 | } |
| 219 | 219 | ||
| @@ -238,7 +238,7 @@ fn main() { | |||
| 238 | let regions_len = flash_memory_regions.len(); | 238 | let regions_len = flash_memory_regions.len(); |
| 239 | flash_regions.extend(quote! { | 239 | flash_regions.extend(quote! { |
| 240 | #[cfg(flash)] | 240 | #[cfg(flash)] |
| 241 | pub struct FlashLayout<'d, MODE> { | 241 | pub struct FlashLayout<'d, MODE = crate::flash::Async> { |
| 242 | #(#fields),*, | 242 | #(#fields),*, |
| 243 | _mode: core::marker::PhantomData<MODE>, | 243 | _mode: core::marker::PhantomData<MODE>, |
| 244 | } | 244 | } |
diff --git a/embassy-stm32/src/flash/f4.rs b/embassy-stm32/src/flash/f4.rs index d50a35b41..3d696223c 100644 --- a/embassy-stm32/src/flash/f4.rs +++ b/embassy-stm32/src/flash/f4.rs | |||
| @@ -54,12 +54,12 @@ mod alt_regions { | |||
| 54 | &ALT_BANK2_REGION3, | 54 | &ALT_BANK2_REGION3, |
| 55 | ]; | 55 | ]; |
| 56 | 56 | ||
| 57 | pub struct AltBank1Region3<'d, MODE>(pub &'static FlashRegion, PeripheralRef<'d, FLASH>, PhantomData<MODE>); | 57 | pub struct AltBank1Region3<'d, MODE = Async>(pub &'static FlashRegion, PeripheralRef<'d, FLASH>, PhantomData<MODE>); |
| 58 | pub struct AltBank2Region1<'d, MODE>(pub &'static FlashRegion, PeripheralRef<'d, FLASH>, PhantomData<MODE>); | 58 | pub struct AltBank2Region1<'d, MODE = Async>(pub &'static FlashRegion, PeripheralRef<'d, FLASH>, PhantomData<MODE>); |
| 59 | pub struct AltBank2Region2<'d, MODE>(pub &'static FlashRegion, PeripheralRef<'d, FLASH>, PhantomData<MODE>); | 59 | pub struct AltBank2Region2<'d, MODE = Async>(pub &'static FlashRegion, PeripheralRef<'d, FLASH>, PhantomData<MODE>); |
| 60 | pub struct AltBank2Region3<'d, MODE>(pub &'static FlashRegion, PeripheralRef<'d, FLASH>, PhantomData<MODE>); | 60 | pub struct AltBank2Region3<'d, MODE = Async>(pub &'static FlashRegion, PeripheralRef<'d, FLASH>, PhantomData<MODE>); |
| 61 | 61 | ||
| 62 | pub struct AltFlashLayout<'d, MODE> { | 62 | pub struct AltFlashLayout<'d, MODE = Async> { |
| 63 | pub bank1_region1: Bank1Region1<'d, MODE>, | 63 | pub bank1_region1: Bank1Region1<'d, MODE>, |
| 64 | pub bank1_region2: Bank1Region2<'d, MODE>, | 64 | pub bank1_region2: Bank1Region2<'d, MODE>, |
| 65 | pub bank1_region3: AltBank1Region3<'d, MODE>, | 65 | pub bank1_region3: AltBank1Region3<'d, MODE>, |
