Enable battery task when ESC sensor is available

This commit is contained in:
Bas Delfos 2016-11-23 22:44:22 +01:00
parent b53cbbefc3
commit 1561481e52
2 changed files with 3 additions and 1 deletions

View File

@ -109,7 +109,7 @@ static void taskHandleSerial(timeUs_t currentTimeUs)
static void taskUpdateBattery(timeUs_t currentTimeUs) static void taskUpdateBattery(timeUs_t currentTimeUs)
{ {
#ifdef USE_ADC #if defined(USE_ADC) || defined(USE_ESC_SENSOR)
static uint32_t vbatLastServiced = 0; static uint32_t vbatLastServiced = 0;
if (feature(FEATURE_VBAT) || feature(FEATURE_ESC_SENSOR)) { if (feature(FEATURE_VBAT) || feature(FEATURE_ESC_SENSOR)) {
if (cmp32(currentTimeUs, vbatLastServiced) >= VBATINTERVAL) { if (cmp32(currentTimeUs, vbatLastServiced) >= VBATINTERVAL) {

View File

@ -295,6 +295,8 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
updateCurrentDrawn(lastUpdateAt); updateCurrentDrawn(lastUpdateAt);
} }
#endif #endif
break;
case CURRENT_SENSOR_NONE: case CURRENT_SENSOR_NONE:
amperage = 0; amperage = 0;