🐛 Fix STM32 FastPWM

This commit is contained in:
Scott Lahteine 2021-11-30 13:03:31 -06:00 committed by Scott Lahteine
parent 0f7f709aad
commit 77af48e547

View File

@ -74,6 +74,8 @@ void set_pwm_frequency(const pin_t pin, int f_desired) {
PinName pin_name = digitalPinToPinName(pin); PinName pin_name = digitalPinToPinName(pin);
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance
const PinName pin_name = digitalPinToPinName(pin);
TIM_TypeDef * const Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance
uint32_t index = get_timer_index(Instance); uint32_t index = get_timer_index(Instance);
// Protect used timers // Protect used timers