@@ -205,15 +205,8 @@ pwmIOConfiguration_t *pwmInit(drv_pwm_config_t *init)
205205 continue ;
206206 }
207207
208- if (pwmMotorConfig (timerHardwarePtr , pwmIOConfiguration .motorCount , init -> motorPwmRate , init -> pwmProtocolType , init -> enablePWMOutput )) {
209- if (init -> useFastPwm ) {
210- pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].flags = PWM_PF_MOTOR | PWM_PF_OUTPUT_PROTOCOL_FASTPWM | PWM_PF_OUTPUT_PROTOCOL_PWM ;
211- } else if (init -> pwmProtocolType == PWM_TYPE_BRUSHED ) {
212- pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].flags = PWM_PF_MOTOR | PWM_PF_MOTOR_MODE_BRUSHED | PWM_PF_OUTPUT_PROTOCOL_PWM ;
213- } else {
214- pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].flags = PWM_PF_MOTOR | PWM_PF_OUTPUT_PROTOCOL_PWM ;
215- }
216-
208+ if (pwmMotorConfig (timerHardwarePtr , pwmIOConfiguration .motorCount , motorConfig ()-> motorPwmRate , init -> enablePWMOutput )) {
209+ pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].flags = PWM_PF_MOTOR ;
217210 pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].index = pwmIOConfiguration .motorCount ;
218211 pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].timerHardware = timerHardwarePtr ;
219212
@@ -232,7 +225,7 @@ pwmIOConfiguration_t *pwmInit(drv_pwm_config_t *init)
232225 }
233226
234227 if (pwmServoConfig (timerHardwarePtr , pwmIOConfiguration .servoCount , init -> servoPwmRate , init -> servoCenterPulse , init -> enablePWMOutput )) {
235- pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].flags = PWM_PF_SERVO | PWM_PF_OUTPUT_PROTOCOL_PWM ;
228+ pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].flags = PWM_PF_SERVO ;
236229 pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].index = pwmIOConfiguration .servoCount ;
237230 pwmIOConfiguration .ioConfigurations [pwmIOConfiguration .ioCount ].timerHardware = timerHardwarePtr ;
238231
0 commit comments