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/timer/low_level.rs | |
| parent | 01c1cb2764300625f80b24e70052f250de27d814 (diff) | |
stm32/rcc: replace generated enable/disable code with runtime info
Diffstat (limited to 'embassy-stm32/src/timer/low_level.rs')
| -rw-r--r-- | embassy-stm32/src/timer/low_level.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/embassy-stm32/src/timer/low_level.rs b/embassy-stm32/src/timer/low_level.rs index 7f533b75c..9932c04cd 100644 --- a/embassy-stm32/src/timer/low_level.rs +++ b/embassy-stm32/src/timer/low_level.rs | |||
| @@ -10,6 +10,7 @@ use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef}; | |||
| 10 | 10 | ||
| 11 | use super::*; | 11 | use super::*; |
| 12 | use crate::pac::timer::vals; | 12 | use crate::pac::timer::vals; |
| 13 | use crate::rcc; | ||
| 13 | use crate::time::Hertz; | 14 | use crate::time::Hertz; |
| 14 | 15 | ||
| 15 | /// Input capture mode. | 16 | /// Input capture mode. |
| @@ -181,7 +182,7 @@ pub struct Timer<'d, T: CoreInstance> { | |||
| 181 | 182 | ||
| 182 | impl<'d, T: CoreInstance> Drop for Timer<'d, T> { | 183 | impl<'d, T: CoreInstance> Drop for Timer<'d, T> { |
| 183 | fn drop(&mut self) { | 184 | fn drop(&mut self) { |
| 184 | T::disable() | 185 | rcc::disable::<T>(); |
| 185 | } | 186 | } |
| 186 | } | 187 | } |
| 187 | 188 | ||
| @@ -190,7 +191,7 @@ impl<'d, T: CoreInstance> Timer<'d, T> { | |||
| 190 | pub fn new(tim: impl Peripheral<P = T> + 'd) -> Self { | 191 | pub fn new(tim: impl Peripheral<P = T> + 'd) -> Self { |
| 191 | into_ref!(tim); | 192 | into_ref!(tim); |
| 192 | 193 | ||
| 193 | T::enable_and_reset(); | 194 | rcc::enable_and_reset::<T>(); |
| 194 | 195 | ||
| 195 | Self { tim } | 196 | Self { tim } |
| 196 | } | 197 | } |
