1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00

Added checks for ESC_SENSOR feature being enabled when reading ESC sensor data. (#5663)

This commit is contained in:
Michael Keller 2018-04-11 23:31:14 +12:00 committed by GitHub
parent 6cfec6fc53
commit e0dcea4d48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 5 deletions

View file

@ -218,7 +218,7 @@ void currentMeterESCRefresh(int32_t lastUpdateAt)
UNUSED(lastUpdateAt);
escSensorData_t *escData = getEscSensorData(ESC_SENSOR_COMBINED);
if (escData->dataAge <= ESC_BATTERY_AGE_MAX) {
if (escData && escData->dataAge <= ESC_BATTERY_AGE_MAX) {
currentMeterESCState.amperage = escData->current;
currentMeterESCState.mAhDrawn = escData->consumption;
} else {