Skip to content

Commit

Permalink
Fix builds when PWM motor protocol is used (#13236)
Browse files Browse the repository at this point in the history
* Fix builds when PWM motor protocol is used

* Enable useUnsyncedPwm for PWM by default
  • Loading branch information
haslinghuis committed Dec 24, 2023
1 parent a39ae3c commit b3be3ed
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/main/pg/motor.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ void pgResetFn_motorConfig(motorConfig_t *motorConfig)
motorConfig->minthrottle = 1070;
motorConfig->dev.motorPwmRate = BRUSHLESS_MOTORS_PWM_RATE;
#ifndef USE_DSHOT
if (motorConfig->dev.motorPwmProtocol == PWM_TYPE_STANDARD) {
motorConfig->dev.useUnsyncedPwm = true;
}
motorConfig->dev.motorPwmProtocol = PWM_TYPE_DISABLED;
#elif defined(DEFAULT_MOTOR_DSHOT_SPEED)
motorConfig->dev.motorPwmProtocol = DEFAULT_MOTOR_DSHOT_SPEED;
Expand Down
2 changes: 0 additions & 2 deletions src/main/target/AT32F435G/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@

#define USE_ADC

#define USE_PWM_OUTPUT

// Remove these undefines as support is added
//#undef USE_BEEPER
//#undef USE_LED_STRIP
Expand Down
2 changes: 0 additions & 2 deletions src/main/target/AT32F435M/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@

#define USE_ADC

#define USE_PWM_OUTPUT

// Remove these undefines as support is added
//#undef USE_BEEPER
//#undef USE_LED_STRIP
Expand Down
2 changes: 2 additions & 0 deletions src/main/target/SITL/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@

#define USE_PARAMETER_GROUPS

#ifndef USE_PWM_OUTPUT
#define USE_PWM_OUTPUT
#endif

#undef USE_STACK_CHECK // I think SITL don't need this
#undef USE_DASHBOARD
Expand Down

0 comments on commit b3be3ed

Please sign in to comment.