aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/cordic
diff options
context:
space:
mode:
authorJan Špaček <[email protected]>2024-05-24 22:04:04 +0200
committerJan Špaček <[email protected]>2024-05-25 18:44:55 +0200
commit081afca3f065dfd91e157d7c9a9477e2d914c99d (patch)
tree574b29636674d3e5a9e3763d00f709635856403e /embassy-stm32/src/cordic
parent01c1cb2764300625f80b24e70052f250de27d814 (diff)
stm32/rcc: replace generated enable/disable code with runtime info
Diffstat (limited to 'embassy-stm32/src/cordic')
-rw-r--r--embassy-stm32/src/cordic/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-stm32/src/cordic/mod.rs b/embassy-stm32/src/cordic/mod.rs
index 29b11735e..fb342d2e7 100644
--- a/embassy-stm32/src/cordic/mod.rs
+++ b/embassy-stm32/src/cordic/mod.rs
@@ -4,7 +4,7 @@ use embassy_hal_internal::drop::OnDrop;
4use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef}; 4use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef};
5 5
6use crate::pac::cordic::vals; 6use crate::pac::cordic::vals;
7use crate::{dma, peripherals}; 7use crate::{dma, peripherals, rcc};
8 8
9mod enums; 9mod enums;
10pub use enums::*; 10pub use enums::*;
@@ -199,7 +199,7 @@ impl<'d, T: Instance> Cordic<'d, T> {
199 /// If you need a peripheral -> CORDIC -> peripheral mode, 199 /// If you need a peripheral -> CORDIC -> peripheral mode,
200 /// you may want to set Cordic into [Mode::ZeroOverhead] mode, and add extra arguments with [Self::extra_config] 200 /// you may want to set Cordic into [Mode::ZeroOverhead] mode, and add extra arguments with [Self::extra_config]
201 pub fn new(peri: impl Peripheral<P = T> + 'd, config: Config) -> Self { 201 pub fn new(peri: impl Peripheral<P = T> + 'd, config: Config) -> Self {
202 T::enable_and_reset(); 202 rcc::enable_and_reset::<T>();
203 203
204 into_ref!(peri); 204 into_ref!(peri);
205 205
@@ -259,7 +259,7 @@ impl<'d, T: Instance> Cordic<'d, T> {
259 259
260impl<'d, T: Instance> Drop for Cordic<'d, T> { 260impl<'d, T: Instance> Drop for Cordic<'d, T> {
261 fn drop(&mut self) { 261 fn drop(&mut self) {
262 T::disable(); 262 rcc::disable::<T>();
263 } 263 }
264} 264}
265 265