refactor(cpn): Support JSON radio hardware definitions (#4406)

This commit is contained in:
Neil Horne
2024-02-04 15:59:04 +10:00
committed by GitHub
parent c6ae44f523
commit 83294613f6
63 changed files with 4166 additions and 2295 deletions
+1 -10
View File
@@ -252,18 +252,9 @@ void OpenTxSimulator::setInputValue(int type, uint8_t index, int16_t value)
switch (type) {
case INPUT_SRC_ANALOG :
case INPUT_SRC_STICK :
setAnalogValue(index, value);
break;
case INPUT_SRC_KNOB :
setAnalogValue(index + adcGetInputOffset(ADC_INPUT_FLEX), value);
break;
case INPUT_SRC_SLIDER :
// TODO redo this when Companion refactored to use radio json adc files
//setAnalogValue(index + adcGetInputOffset(ADC_INPUT_FLEX), value);
static const int slideroffset = adcGetInputIdx("SL1", 3);
//qDebug() << "SL1:" << slideroffset;
if (slideroffset >= 0)
setAnalogValue(index + slideroffset, value);
setAnalogValue(index, value);
break;
case INPUT_SRC_TXVIN :
if (adcGetMaxInputs(ADC_INPUT_VBAT) > 0) {