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

CF/BF - move adc current sensor default scale and offset to target.h instead of

target specific config.c
This commit is contained in:
Hydra 2017-03-16 22:28:09 +00:00 committed by Dominic Clifton
parent f3e740c598
commit dbd819c85a
9 changed files with 25 additions and 26 deletions

View file

@ -45,6 +45,10 @@ static biquadFilter_t adciBatFilter;
#define CURRENT_METER_SCALE_DEFAULT 400 // for Allegro ACS758LCB-100U (40mV/A)
#endif
#ifndef CURRENT_METER_OFFSET_DEFAULT
#define CURRENT_METER_OFFSET_DEFAULT 0
#endif
PG_REGISTER_ARRAY_WITH_RESET_FN(currentMeterADCOrVirtualConfig_t, MAX_ADC_OR_VIRTUAL_CURRENT_METERS, currentMeterADCOrVirtualConfig, PG_CURRENT_SENSOR_ADC_OR_VIRTUAL_CONFIG, 0);
void pgResetFn_currentMeterADCOrVirtualConfig(currentMeterADCOrVirtualConfig_t *instance)
@ -53,6 +57,7 @@ void pgResetFn_currentMeterADCOrVirtualConfig(currentMeterADCOrVirtualConfig_t *
if (i == CURRENT_METER_ADC) {
RESET_CONFIG(currentMeterADCOrVirtualConfig_t, &instance[i],
.scale = CURRENT_METER_SCALE_DEFAULT,
.offset = CURRENT_METER_OFFSET_DEFAULT,
);
}
}