Skip to content

Commit

Permalink
fix mixer.c for when undefining USE_BRUSHED_ESC_AUTODETECT (#854)
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdCopter authored Oct 31, 2022
1 parent 34f301f commit 03263ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/flight/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,12 @@ float applyThrottleLimit(float throttle) {

void mixWithThrottleLegacy(float *motorMix, float *controllerMix, float controllerMixMin, float controllerMixMax) {
float throttleThrust = currentPidProfile->linear_throttle ? throttle : motorToThrust(throttle, true);

#ifdef USE_BRUSHED_ESC_AUTODETECT
float normFactor = 1 / (controllerMixRange > 1.0f && hardwareMotorType != MOTOR_BRUSHED ? controllerMixRange : 1.0f);
#else
float normFactor = 1 / (controllerMixRange > 1.0f ? controllerMixRange : 1.0f);
#endif

if (mixerImpl == MIXER_IMPL_LEGACY) {
// legacy clipping handling
Expand Down

0 comments on commit 03263ad

Please sign in to comment.