File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,13 @@ STATIC void dac_deinit(uint32_t dac_channel) {
131131 #endif
132132}
133133
134+ void dac_deinit_all (void ) {
135+ dac_deinit (DAC_CHANNEL_1 );
136+ #if !defined(STM32L452xx )
137+ dac_deinit (DAC_CHANNEL_2 );
138+ #endif
139+ }
140+
134141STATIC void dac_config_channel (uint32_t dac_channel , uint32_t trig , uint32_t outbuf ) {
135142 DAC -> CR &= ~(DAC_CR_EN1 << dac_channel );
136143 uint32_t cr_off = DAC_CR_DMAEN1 | DAC_CR_MAMP1 | DAC_CR_WAVE1 | DAC_CR_TSEL1 | DAC_CR_TEN1 ;
Original file line number Diff line number Diff line change 2828
2929extern const mp_obj_type_t pyb_dac_type ;
3030
31+ void dac_deinit_all (void );
32+
3133#endif // MICROPY_INCLUDED_STM32_DAC_H
Original file line number Diff line number Diff line change @@ -654,6 +654,9 @@ void stm32_main(uint32_t reset_mode) {
654654 #if MICROPY_HW_ENABLE_CAN
655655 can_deinit_all ();
656656 #endif
657+ #if MICROPY_HW_ENABLE_DAC
658+ dac_deinit_all ();
659+ #endif
657660 machine_deinit ();
658661
659662 #if MICROPY_PY_THREAD
You can’t perform that action at this time.
0 commit comments