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
1 changed files with 15 additions and 0 deletions

View File

@ -916,6 +916,9 @@ static servoMixer_t customServoMixersCopy[MAX_SERVO_RULES];
static servoParam_t servoParamsCopy[MAX_SUPPORTED_SERVOS];
#endif
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 mixerConfig_t mixerConfigCopy;
static flight3DConfig_t flight3DConfigCopy;
@ -1219,6 +1222,18 @@ static const cliCurrentAndDefaultConfig_t *getCurrentAndDefaultConfigs(pgn_t pgn
ret.currentConfig = &batteryConfigCopy;
ret.defaultConfig = batteryConfig();
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:
ret.currentConfig = &serialConfigCopy;
ret.defaultConfig = serialConfig();