1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +03:00

Change virtual current meter to use setpoint rather than rcCommand throttle

Use the final calculated throttle value that may be affected by throttle limiting, throttle boost, etc. instead of the rcCommand input when calculating the virtual current meter.
This commit is contained in:
Bruce Luckcuck 2019-11-08 16:16:16 -05:00
parent c77c593a14
commit be79913726
4 changed files with 14 additions and 10 deletions

View file

@ -472,7 +472,7 @@ void stopMotors(void)
}
static FAST_RAM_ZERO_INIT float throttle = 0;
static FAST_RAM_ZERO_INIT float loggingThrottle = 0;
static FAST_RAM_ZERO_INIT float mixerThrottle = 0;
static FAST_RAM_ZERO_INIT float motorOutputMin;
static FAST_RAM_ZERO_INIT float motorRangeMin;
static FAST_RAM_ZERO_INIT float motorRangeMax;
@ -891,7 +891,7 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
throttle += pidGetAirmodeThrottleOffset();
float airmodeThrottleChange = 0;
#endif
loggingThrottle = throttle;
mixerThrottle = throttle;
motorMixRange = motorMixMax - motorMixMin;
if (motorMixRange > 1.0f) {
@ -934,7 +934,7 @@ void mixerSetThrottleAngleCorrection(int correctionValue)
throttleAngleCorrection = correctionValue;
}
float mixerGetLoggingThrottle(void)
float mixerGetThrottle(void)
{
return loggingThrottle;
return mixerThrottle;
}