Remove fallback on ADC sensor when ESC sensor fails

This commit is contained in:
Bas Delfos 2016-11-24 20:49:23 +01:00
parent 036c7d0c89
commit 7e26afddf1
2 changed files with 6 additions and 4 deletions

View File

@ -84,12 +84,17 @@ static void updateBatteryVoltage(void)
}
#ifdef USE_ESC_SENSOR
<<<<<<< 0a89e28c8e6e538d5b283fe9a389c481f24523fb
if (feature(FEATURE_ESC_SENSOR) && batteryConfig->batteryMeterType == BATTERY_SENSOR_ESC) {
vbatLatest = getEscSensorVbat();
if (debugMode == DEBUG_BATTERY) {
debug[0] = -1;
}
vbat = biquadFilterApply(&vBatFilter, vbatLatest);
=======
if (batteryConfig->batteryMeterType == BATTERY_SENSOR_ESC) {
vbatSample = vbatLatest = getEscSensorVbat();
>>>>>>> Remove fallback on ADC sensor when ESC sensor fails
}
else
#endif
@ -291,8 +296,6 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
{
amperage = getEscSensorCurrent();
mAhDrawn = getEscSensorConsumption();
updateCurrentDrawn(lastUpdateAt);
}
#endif

View File

@ -269,11 +269,10 @@ void escSensorProcess(timeUs_t currentTimeUs)
if (escTriggerLastTimestamp + 10000 < currentTimeMs) {
// ESCs did not respond for 10 seconds
// Disable ESC telemetry and fallback to onboard vbat sensor
// Disable ESC telemetry and reset voltage and current to let the use know something is wrong
freeEscSensorPort();
escVbat = 0;
escCurrent = 0;
escConsumption = 0;
}
}