From 1c1231b6fee5c54992b33855e4a587071742a6ea Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 24 May 2024 21:11:33 +1000 Subject: [PATCH] Mask Timer around changing timer rate --- source/Core/BSP/Pinecilv2/IRQ.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/Core/BSP/Pinecilv2/IRQ.cpp b/source/Core/BSP/Pinecilv2/IRQ.cpp index 02bc4700..2c24685f 100644 --- a/source/Core/BSP/Pinecilv2/IRQ.cpp +++ b/source/Core/BSP/Pinecilv2/IRQ.cpp @@ -69,6 +69,7 @@ volatile uint8_t pendingPWM = 0; volatile bool pendingNextPeriodIsFast = false; void start_PWM_output(void) { + TIMER_Disable(TIMER_CH0); if (PWMSafetyTimer) { PWMSafetyTimer--; @@ -92,6 +93,7 @@ void start_PWM_output(void) { PWM_Channel_Disable(PWM_Channel); switchToFastPWM(); } + TIMER_Enable(TIMER_CH0); } // Timer 0 is used to co-ordinate the ADC and the output PWM