From 0887bbe3cf8ecff5422970f5bb6d46596e6acb24 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 8 May 2021 16:28:33 +1000 Subject: [PATCH] Mask PWM during beep --- source/Core/BSP/MHP30/BSP.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/Core/BSP/MHP30/BSP.cpp b/source/Core/BSP/MHP30/BSP.cpp index 7b87103e..850c1c83 100644 --- a/source/Core/BSP/MHP30/BSP.cpp +++ b/source/Core/BSP/MHP30/BSP.cpp @@ -252,7 +252,11 @@ bool tryBetterPWM(uint8_t pwm) { } void setTipPWM(uint8_t pulse) { // We can just set the timer directly - htim3.Instance->CCR1 = pulse; + if (htim3.Instance->PSC > 20) { + htim3.Instance->CCR1 = 0; + } else { + htim3.Instance->CCR1 = pulse; + } } void unstick_I2C() {