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

Cleaned up parameter group handling.

Fixed missing include.
This commit is contained in:
mikeller 2017-11-19 13:41:48 +13:00
parent 9eb83d1e5f
commit 09d396c05c
41 changed files with 125 additions and 157 deletions

View file

@ -133,11 +133,19 @@ void currentMeterADCInit(void)
void currentMeterADCRefresh(int32_t lastUpdateAt)
{
#ifdef USE_ADC
const uint16_t iBatSample = adcGetChannel(ADC_CURRENT);
currentMeterADCState.amperageLatest = currentMeterADCToCentiamps(iBatSample);
currentMeterADCState.amperage = currentMeterADCToCentiamps(biquadFilterApply(&adciBatFilter, iBatSample));
updateCurrentmAhDrawnState(&currentMeterADCState.mahDrawnState, currentMeterADCState.amperageLatest, lastUpdateAt);
#else
UNUSED(lastUpdateAt);
UNUSED(currentMeterADCToCentiamps);
currentMeterADCState.amperageLatest = 0;
currentMeterADCState.amperage = 0;
#endif
}
void currentMeterADCRead(currentMeter_t *meter)