mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Mask Timer around changing timer rate
This commit is contained in:
committed by
Ben V. Brown
parent
4b1b370da9
commit
1c1231b6fe
@@ -69,6 +69,7 @@ volatile uint8_t pendingPWM = 0;
|
|||||||
volatile bool pendingNextPeriodIsFast = false;
|
volatile bool pendingNextPeriodIsFast = false;
|
||||||
|
|
||||||
void start_PWM_output(void) {
|
void start_PWM_output(void) {
|
||||||
|
TIMER_Disable(TIMER_CH0);
|
||||||
|
|
||||||
if (PWMSafetyTimer) {
|
if (PWMSafetyTimer) {
|
||||||
PWMSafetyTimer--;
|
PWMSafetyTimer--;
|
||||||
@@ -92,6 +93,7 @@ void start_PWM_output(void) {
|
|||||||
PWM_Channel_Disable(PWM_Channel);
|
PWM_Channel_Disable(PWM_Channel);
|
||||||
switchToFastPWM();
|
switchToFastPWM();
|
||||||
}
|
}
|
||||||
|
TIMER_Enable(TIMER_CH0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Timer 0 is used to co-ordinate the ADC and the output PWM
|
// Timer 0 is used to co-ordinate the ADC and the output PWM
|
||||||
|
|||||||
Reference in New Issue
Block a user