Restore mAhDrawn for targets with ESC_TELEMETRY
This commit is contained in:
parent
7b6ccaca6b
commit
eb503deed3
|
@ -195,10 +195,9 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
|
||||||
{
|
{
|
||||||
#ifdef USE_ESC_TELEMETRY
|
#ifdef USE_ESC_TELEMETRY
|
||||||
UNUSED(lastUpdateAt);
|
UNUSED(lastUpdateAt);
|
||||||
#else
|
|
||||||
static int64_t mAhdrawnRaw = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int64_t mAhdrawnRaw = 0;
|
||||||
static int32_t amperageRaw = 0;
|
static int32_t amperageRaw = 0;
|
||||||
|
|
||||||
int32_t throttleOffset = (int32_t)rcCommand[THROTTLE] - 1000;
|
int32_t throttleOffset = (int32_t)rcCommand[THROTTLE] - 1000;
|
||||||
|
@ -233,10 +232,10 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_ESC_TELEMETRY
|
if (!feature(FEATURE_ESC_TELEMETRY)) {
|
||||||
mAhdrawnRaw += (amperage * lastUpdateAt) / 1000;
|
mAhdrawnRaw += (amperage * lastUpdateAt) / 1000;
|
||||||
mAhDrawn = mAhdrawnRaw / (3600 * 100);
|
mAhDrawn = mAhdrawnRaw / (3600 * 100);
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float calculateVbatPidCompensation(void) {
|
float calculateVbatPidCompensation(void) {
|
||||||
|
|
Loading…
Reference in New Issue