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

CF/BF - Remove usage of USE_FC based on PR discussion decisions. Add

USE_VIRTUAL_CURRENT_METER.
This commit is contained in:
Hydra 2017-04-11 08:56:54 +01:00 committed by Dominic Clifton
parent b4dc3b53f5
commit be063ebbbf
11 changed files with 66 additions and 64 deletions

View file

@ -38,7 +38,7 @@
const uint8_t currentMeterIds[] = {
CURRENT_METER_ID_BATTERY_1,
#ifdef USE_FC
#ifdef USE_VIRTUAL_CURRENT_METER
CURRENT_METER_ID_VIRTUAL_1,
#endif
#ifdef USE_ESC_SENSOR
@ -95,7 +95,9 @@ PG_RESET_TEMPLATE(currentSensorADCConfig_t, currentSensorADCConfig,
.offset = CURRENT_METER_OFFSET_DEFAULT,
);
#ifdef USE_VIRTUAL_CURRENT_METER
PG_REGISTER(currentSensorVirtualConfig_t, currentSensorVirtualConfig, PG_CURRENT_SENSOR_VIRTUAL_CONFIG, 0);
#endif
static int32_t currentMeterADCToCentiamps(const uint16_t src)
{
@ -146,7 +148,7 @@ void currentMeterADCRead(currentMeter_t *meter)
// VIRTUAL
//
#ifdef USE_FC
#ifdef USE_VIRTUAL_CURRENT_METER
currentSensorVirtualState_t currentMeterVirtualState;
void currentMeterVirtualInit(void)
@ -234,7 +236,7 @@ void currentMeterRead(currentMeterId_e id, currentMeter_t *meter)
if (id == CURRENT_METER_ID_BATTERY_1) {
currentMeterADCRead(meter);
}
#ifdef USE_FC
#ifdef USE_VIRTUAL_CURRENT_METER
else if (id == CURRENT_METER_ID_VIRTUAL_1) {
currentMeterVirtualRead(meter);
}