diff --git a/src/main/sensors/current.c b/src/main/sensors/current.c index 9e3c83424..403166fd6 100644 --- a/src/main/sensors/current.c +++ b/src/main/sensors/current.c @@ -220,11 +220,12 @@ void currentMeterESCReadMotor(uint8_t motorNumber, currentMeter_t *meter) currentMeterReset(meter); #else escSensorData_t *escData = getEscSensorData(motorNumber); - if (escData->dataAge <= ESC_BATTERY_AGE_MAX) { + if (escData && escData->dataAge <= ESC_BATTERY_AGE_MAX) { meter->amperage = escData->current; meter->amperageLatest = escData->current; meter->mAhDrawn = escData->consumption; - return; + } else { + currentMeterReset(meter); } #endif } diff --git a/src/main/sensors/voltage.c b/src/main/sensors/voltage.c index 22cc1105b..aa9db9dfe 100644 --- a/src/main/sensors/voltage.c +++ b/src/main/sensors/voltage.c @@ -221,9 +221,13 @@ void voltageMeterESCReadMotor(uint8_t motorNumber, voltageMeter_t *voltageMeter) voltageMeterReset(voltageMeter); #else escSensorData_t *escData = getEscSensorData(motorNumber); + if (escData) { + voltageMeter->unfiltered = escData->dataAge <= ESC_BATTERY_AGE_MAX ? escData->voltage / 10 : 0; + voltageMeter->filtered = voltageMeter->unfiltered; // no filtering for ESC motors currently. + } else { + voltageMeterReset(voltageMeter); + } - voltageMeter->unfiltered = escData->dataAge <= ESC_BATTERY_AGE_MAX ? escData->voltage / 10 : 0; - voltageMeter->filtered = voltageMeter->unfiltered; // no filtering for ESC motors currently. #endif }