diff options
| author | pbert <[email protected]> | 2023-10-11 21:38:41 +0200 |
|---|---|---|
| committer | pbert <[email protected]> | 2023-10-12 11:04:44 +0200 |
| commit | ecdd7c0e2f9dcc07e53e136557140d3ccc6a5ee1 (patch) | |
| tree | 6db9bf875d3e83d94f6bf8e8a2e7ff03a83c5bb4 /embassy-stm32/src/dac | |
| parent | d7d79f3068a4a2d883b078b8900ad194f7c98203 (diff) | |
enable clock first
Diffstat (limited to 'embassy-stm32/src/dac')
| -rw-r--r-- | embassy-stm32/src/dac/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/embassy-stm32/src/dac/mod.rs b/embassy-stm32/src/dac/mod.rs index e93fca954..6458572f2 100644 --- a/embassy-stm32/src/dac/mod.rs +++ b/embassy-stm32/src/dac/mod.rs | |||
| @@ -255,7 +255,7 @@ impl<'d, T: Instance, Tx> DacCh1<'d, T, Tx> { | |||
| 255 | ) -> Self { | 255 | ) -> Self { |
| 256 | pin.set_as_analog(); | 256 | pin.set_as_analog(); |
| 257 | into_ref!(peri, dma); | 257 | into_ref!(peri, dma); |
| 258 | T::reset_and_enable(); | 258 | T::enable_and_reset(); |
| 259 | 259 | ||
| 260 | let mut dac = Self { _peri: peri, dma }; | 260 | let mut dac = Self { _peri: peri, dma }; |
| 261 | 261 | ||
| @@ -365,7 +365,7 @@ impl<'d, T: Instance, Tx> DacCh2<'d, T, Tx> { | |||
| 365 | ) -> Self { | 365 | ) -> Self { |
| 366 | pin.set_as_analog(); | 366 | pin.set_as_analog(); |
| 367 | into_ref!(_peri, dma); | 367 | into_ref!(_peri, dma); |
| 368 | T::reset_and_enable(); | 368 | T::enable_and_reset(); |
| 369 | 369 | ||
| 370 | let mut dac = Self { | 370 | let mut dac = Self { |
| 371 | phantom: PhantomData, | 371 | phantom: PhantomData, |
| @@ -481,7 +481,7 @@ impl<'d, T: Instance, TxCh1, TxCh2> Dac<'d, T, TxCh1, TxCh2> { | |||
| 481 | pin_ch1.set_as_analog(); | 481 | pin_ch1.set_as_analog(); |
| 482 | pin_ch2.set_as_analog(); | 482 | pin_ch2.set_as_analog(); |
| 483 | into_ref!(peri, dma_ch1, dma_ch2); | 483 | into_ref!(peri, dma_ch1, dma_ch2); |
| 484 | T::reset_and_enable(); | 484 | T::enable_and_reset(); |
| 485 | 485 | ||
| 486 | let mut dac_ch1 = DacCh1 { | 486 | let mut dac_ch1 = DacCh1 { |
| 487 | _peri: peri, | 487 | _peri: peri, |
| @@ -567,7 +567,7 @@ foreach_peripheral!( | |||
| 567 | critical_section::with(|_| unsafe { crate::rcc::get_freqs().apb1 }) | 567 | critical_section::with(|_| unsafe { crate::rcc::get_freqs().apb1 }) |
| 568 | } | 568 | } |
| 569 | 569 | ||
| 570 | fn reset_and_enable() { | 570 | fn enable_and_reset() { |
| 571 | critical_section::with(|_| { | 571 | critical_section::with(|_| { |
| 572 | crate::pac::RCC.apb1lrstr().modify(|w| w.set_dac12rst(true)); | 572 | crate::pac::RCC.apb1lrstr().modify(|w| w.set_dac12rst(true)); |
| 573 | crate::pac::RCC.apb1lrstr().modify(|w| w.set_dac12rst(false)); | 573 | crate::pac::RCC.apb1lrstr().modify(|w| w.set_dac12rst(false)); |
