mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
Remove fallback on ADC sensor when ESC sensor fails
This commit is contained in:
parent
036c7d0c89
commit
7e26afddf1
2 changed files with 6 additions and 4 deletions
|
@ -84,12 +84,17 @@ static void updateBatteryVoltage(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_ESC_SENSOR
|
#ifdef USE_ESC_SENSOR
|
||||||
|
<<<<<<< 0a89e28c8e6e538d5b283fe9a389c481f24523fb
|
||||||
if (feature(FEATURE_ESC_SENSOR) && batteryConfig->batteryMeterType == BATTERY_SENSOR_ESC) {
|
if (feature(FEATURE_ESC_SENSOR) && batteryConfig->batteryMeterType == BATTERY_SENSOR_ESC) {
|
||||||
vbatLatest = getEscSensorVbat();
|
vbatLatest = getEscSensorVbat();
|
||||||
if (debugMode == DEBUG_BATTERY) {
|
if (debugMode == DEBUG_BATTERY) {
|
||||||
debug[0] = -1;
|
debug[0] = -1;
|
||||||
}
|
}
|
||||||
vbat = biquadFilterApply(&vBatFilter, vbatLatest);
|
vbat = biquadFilterApply(&vBatFilter, vbatLatest);
|
||||||
|
=======
|
||||||
|
if (batteryConfig->batteryMeterType == BATTERY_SENSOR_ESC) {
|
||||||
|
vbatSample = vbatLatest = getEscSensorVbat();
|
||||||
|
>>>>>>> Remove fallback on ADC sensor when ESC sensor fails
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -291,8 +296,6 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
|
||||||
{
|
{
|
||||||
amperage = getEscSensorCurrent();
|
amperage = getEscSensorCurrent();
|
||||||
mAhDrawn = getEscSensorConsumption();
|
mAhDrawn = getEscSensorConsumption();
|
||||||
|
|
||||||
updateCurrentDrawn(lastUpdateAt);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -269,11 +269,10 @@ void escSensorProcess(timeUs_t currentTimeUs)
|
||||||
|
|
||||||
if (escTriggerLastTimestamp + 10000 < currentTimeMs) {
|
if (escTriggerLastTimestamp + 10000 < currentTimeMs) {
|
||||||
// ESCs did not respond for 10 seconds
|
// 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();
|
freeEscSensorPort();
|
||||||
escVbat = 0;
|
escVbat = 0;
|
||||||
escCurrent = 0;
|
escCurrent = 0;
|
||||||
escConsumption = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue