feat: More flexible ADC inputs (#3870)

Co-authored-by: 3djc <lesitewebdejc@hotmail.com>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
This commit is contained in:
Raphael Coeffic
2023-11-02 11:07:53 +10:00
committed by GitHub
co-authored by 3djc Peter Feerick philmoz
parent f5593c44e8
commit b48e07026d
78 changed files with 1291 additions and 773 deletions
+3 -3
View File
@@ -51,7 +51,7 @@ QVector<QIODevice *> OpenTxSimulator::tracebackDevices;
uint16_t simu_get_analog(uint8_t idx)
{
// 6POS simu mechanism use a different scale, so needs specific offset
if (IS_POT_MULTIPOS(idx - adcGetInputOffset(ADC_INPUT_POT))) {
if (IS_POT_MULTIPOS(idx - adcGetInputOffset(ADC_INPUT_FLEX))) {
// Use radio calibration data to determine conversion factor
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[idx];
int range6POS = 2048; // Default if calibration is not valid
@@ -256,11 +256,11 @@ void OpenTxSimulator::setInputValue(int type, uint8_t index, int16_t value)
setAnalogValue(index, value);
break;
case INPUT_SRC_KNOB :
setAnalogValue(index + adcGetInputOffset(ADC_INPUT_POT), value);
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_POT), value);
//setAnalogValue(index + adcGetInputOffset(ADC_INPUT_FLEX), value);
static const int slideroffset = adcGetInputIdx("SL1", 3);
//qDebug() << "SL1:" << slideroffset;
if (slideroffset >= 0)