mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Safer PWM Init
This commit is contained in:
@@ -63,7 +63,7 @@ static bool fastPWM = false;
|
||||
static void switchToFastPWM(void);
|
||||
|
||||
volatile uint16_t PWMSafetyTimer = 0;
|
||||
volatile uint8_t pendingPWM = 200;
|
||||
volatile uint8_t pendingPWM = 0;
|
||||
volatile bool lastPeriodWasFast = false;
|
||||
|
||||
// Timer 0 is used to co-ordinate the ADC and the output PWM
|
||||
@@ -91,6 +91,8 @@ void timer0_comp2_callback(void) {
|
||||
// Leave output off
|
||||
PWM_Channel_Disable(PWM_Channel);
|
||||
}
|
||||
} else {
|
||||
PWM_Channel_Disable(PWM_Channel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user