Mask PWM during beep

This commit is contained in:
Ben V. Brown
2021-05-08 16:28:33 +10:00
parent f752e694df
commit 0887bbe3cf

View File

@@ -252,8 +252,12 @@ bool tryBetterPWM(uint8_t pwm) {
} }
void setTipPWM(uint8_t pulse) { void setTipPWM(uint8_t pulse) {
// We can just set the timer directly // We can just set the timer directly
if (htim3.Instance->PSC > 20) {
htim3.Instance->CCR1 = 0;
} else {
htim3.Instance->CCR1 = pulse; htim3.Instance->CCR1 = pulse;
} }
}
void unstick_I2C() { void unstick_I2C() {
GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitTypeDef GPIO_InitStruct;