From b16cc04036da8bcbfe273cd796c092e8e2a074c9 Mon Sep 17 00:00:00 2001 From: eZio Pan Date: Mon, 8 Jan 2024 19:18:24 +0800 Subject: [PATCH] bug fix --- embassy-stm32/src/timer/simple_pwm.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/embassy-stm32/src/timer/simple_pwm.rs b/embassy-stm32/src/timer/simple_pwm.rs index 709278c0c..ba089ac8b 100644 --- a/embassy-stm32/src/timer/simple_pwm.rs +++ b/embassy-stm32/src/timer/simple_pwm.rs @@ -245,7 +245,8 @@ macro_rules! impl_waveform_chx { let original_cc_dma_on_update = self.inner.get_cc_dma_selection() == Ccds::ONUPDATE; let original_cc_dma_enabled = self.inner.get_cc_dma_enable_state(cc_channel); - if original_cc_dma_on_update { + // redirect CC DMA request onto Update Event + if !original_cc_dma_on_update { self.inner.set_cc_dma_selection(Ccds::ONUPDATE) }