Skip to content

Commit 514f1c1

Browse files
author
Richard Unger
committed
STM32 driver refactor (not yet tested)
1 parent fba8876 commit 514f1c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/drivers/hardware_specific/stm32_mcu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void _alignPWMTimers(HardwareTimer *HT1,HardwareTimer *HT2,HardwareTimer *HT3,Ha
142142
}
143143

144144
// configure hardware 6pwm interface only one timer with inverted channels
145-
STM32DriverParams* _initHardware6PWMInterface(uint32_t PWM_freq, float dead_zone, int pinA_h, int pinA_l, int pinB_h, int pinB_l, int pinC_h, int pinC_l)
145+
STM32DriverParams* _initHardware6PWMInterface(long PWM_freq, float dead_zone, int pinA_h, int pinA_l, int pinB_h, int pinB_l, int pinC_h, int pinC_l)
146146
{
147147

148148
#if !defined(STM32L0xx) // L0 boards dont have hardware 6pwm interface
@@ -168,7 +168,7 @@ STM32DriverParams* _initHardware6PWMInterface(uint32_t PWM_freq, float dead_zone
168168
HardwareTimer_Handle[index]->handle.Init.CounterMode = TIM_COUNTERMODE_CENTERALIGNED3;
169169
HardwareTimer_Handle[index]->handle.Init.RepetitionCounter = 1;
170170
HAL_TIM_Base_Init(&(HardwareTimer_Handle[index]->handle));
171-
((HardwareTimer *)HardwareTimer_Handle[index]->__this)->setOverflow(PWM_freq, HERTZ_FORMAT);
171+
((HardwareTimer *)HardwareTimer_Handle[index]->__this)->setOverflow((uint32_t)PWM_freq, HERTZ_FORMAT);
172172
}
173173
HardwareTimer *HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this);
174174

0 commit comments

Comments
 (0)