1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 14:55:21 +03:00

CF/BF - add cli diff support for voltage and current sensors.

This commit is contained in:
Hydra 2017-03-18 19:42:00 +00:00 committed by Dominic Clifton
parent 4554019c52
commit 31dc531ca0

View file

@ -916,6 +916,9 @@ static servoMixer_t customServoMixersCopy[MAX_SERVO_RULES];
static servoParam_t servoParamsCopy[MAX_SUPPORTED_SERVOS]; static servoParam_t servoParamsCopy[MAX_SUPPORTED_SERVOS];
#endif #endif
static batteryConfig_t batteryConfigCopy; static batteryConfig_t batteryConfigCopy;
static voltageSensorADCConfig_t voltageSensorADCConfigCopy[MAX_VOLTAGE_SENSOR_ADC];
static currentSensorADCConfig_t currentSensorADCConfigCopy;
static currentSensorVirtualConfig_t currentSensorVirtualConfigCopy;
static motorMixer_t customMotorMixerCopy[MAX_SUPPORTED_MOTORS]; static motorMixer_t customMotorMixerCopy[MAX_SUPPORTED_MOTORS];
static mixerConfig_t mixerConfigCopy; static mixerConfig_t mixerConfigCopy;
static flight3DConfig_t flight3DConfigCopy; static flight3DConfig_t flight3DConfigCopy;
@ -1219,6 +1222,18 @@ static const cliCurrentAndDefaultConfig_t *getCurrentAndDefaultConfigs(pgn_t pgn
ret.currentConfig = &batteryConfigCopy; ret.currentConfig = &batteryConfigCopy;
ret.defaultConfig = batteryConfig(); ret.defaultConfig = batteryConfig();
break; break;
case PG_VOLTAGE_SENSOR_ADC_CONFIG:
ret.currentConfig = &voltageSensorADCConfigCopy[0];
ret.defaultConfig = voltageSensorADCConfig(0);
break;
case PG_CURRENT_SENSOR_ADC_CONFIG:
ret.currentConfig = &currentSensorADCConfigCopy;
ret.defaultConfig = currentSensorADCConfig();
break;
case PG_CURRENT_SENSOR_VIRTUAL_CONFIG:
ret.currentConfig = &currentSensorVirtualConfigCopy;
ret.defaultConfig = currentSensorVirtualConfig();
break;
case PG_SERIAL_CONFIG: case PG_SERIAL_CONFIG:
ret.currentConfig = &serialConfigCopy; ret.currentConfig = &serialConfigCopy;
ret.defaultConfig = serialConfig(); ret.defaultConfig = serialConfig();