Restore mAhDrawn for targets with ESC_TELEMETRY

This commit is contained in:
Florian Ragwitz 2016-11-19 13:12:02 -08:00
parent 7b6ccaca6b
commit eb503deed3
1 changed files with 5 additions and 6 deletions

View File

@ -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) {