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:
parent
6cfec6fc53
commit
e0dcea4d48
5 changed files with 21 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue