diff options
| author | Jan Špaček <[email protected]> | 2024-05-24 22:04:04 +0200 |
|---|---|---|
| committer | Jan Špaček <[email protected]> | 2024-05-25 18:44:55 +0200 |
| commit | 081afca3f065dfd91e157d7c9a9477e2d914c99d (patch) | |
| tree | 574b29636674d3e5a9e3763d00f709635856403e /embassy-stm32/src/usb | |
| parent | 01c1cb2764300625f80b24e70052f250de27d814 (diff) | |
stm32/rcc: replace generated enable/disable code with runtime info
Diffstat (limited to 'embassy-stm32/src/usb')
| -rw-r--r-- | embassy-stm32/src/usb/mod.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/usb/otg.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/embassy-stm32/src/usb/mod.rs b/embassy-stm32/src/usb/mod.rs index 349438ec5..ce9fe0a9b 100644 --- a/embassy-stm32/src/usb/mod.rs +++ b/embassy-stm32/src/usb/mod.rs | |||
| @@ -6,7 +6,7 @@ mod _version; | |||
| 6 | pub use _version::*; | 6 | pub use _version::*; |
| 7 | 7 | ||
| 8 | use crate::interrupt::typelevel::Interrupt; | 8 | use crate::interrupt::typelevel::Interrupt; |
| 9 | use crate::rcc::SealedRccPeripheral; | 9 | use crate::rcc; |
| 10 | 10 | ||
| 11 | /// clock, power initialization stuff that's common for USB and OTG. | 11 | /// clock, power initialization stuff that's common for USB and OTG. |
| 12 | fn common_init<T: Instance>() { | 12 | fn common_init<T: Instance>() { |
| @@ -65,5 +65,5 @@ fn common_init<T: Instance>() { | |||
| 65 | T::Interrupt::unpend(); | 65 | T::Interrupt::unpend(); |
| 66 | unsafe { T::Interrupt::enable() }; | 66 | unsafe { T::Interrupt::enable() }; |
| 67 | 67 | ||
| 68 | <T as SealedRccPeripheral>::enable_and_reset(); | 68 | rcc::enable_and_reset::<T>(); |
| 69 | } | 69 | } |
diff --git a/embassy-stm32/src/usb/otg.rs b/embassy-stm32/src/usb/otg.rs index 3debd5079..e5131250a 100644 --- a/embassy-stm32/src/usb/otg.rs +++ b/embassy-stm32/src/usb/otg.rs | |||
| @@ -13,7 +13,7 @@ use embassy_usb_synopsys_otg::{ | |||
| 13 | use crate::gpio::AFType; | 13 | use crate::gpio::AFType; |
| 14 | use crate::interrupt; | 14 | use crate::interrupt; |
| 15 | use crate::interrupt::typelevel::Interrupt; | 15 | use crate::interrupt::typelevel::Interrupt; |
| 16 | use crate::rcc::{RccPeripheral, SealedRccPeripheral}; | 16 | use crate::rcc::{self, RccPeripheral}; |
| 17 | 17 | ||
| 18 | const MAX_EP_COUNT: usize = 9; | 18 | const MAX_EP_COUNT: usize = 9; |
| 19 | 19 | ||
| @@ -246,7 +246,7 @@ impl<'d, T: Instance> Bus<'d, T> { | |||
| 246 | fn disable(&mut self) { | 246 | fn disable(&mut self) { |
| 247 | T::Interrupt::disable(); | 247 | T::Interrupt::disable(); |
| 248 | 248 | ||
| 249 | <T as SealedRccPeripheral>::disable(); | 249 | rcc::disable::<T>(); |
| 250 | self.inited = false; | 250 | self.inited = false; |
| 251 | 251 | ||
| 252 | #[cfg(stm32l4)] | 252 | #[cfg(stm32l4)] |
