diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 052b5a176..711b68764 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -195,12 +195,12 @@ QString AnalogString(int index) { static const QString sticks[] = { QObject::tr("Rud"), QObject::tr("Ele"), QObject::tr("Thr"), QObject::tr("Ail") }; static const QString pots9X[] = { QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3") }; - static const QString potsX9D[] = { QObject::tr("S1"), QObject::tr("S2"), QObject::tr("LS"), QObject::tr("RS") }; + static const QString potsTaranis[] = { QObject::tr("S1"), QObject::tr("S2"), QObject::tr("S3"), QObject::tr("LS"), QObject::tr("RS") }; if (index < 4) return CHECK_IN_ARRAY(sticks, index); else - return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(potsX9D, index-4) : CHECK_IN_ARRAY(pots9X, index-4)); + return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(potsTaranis, index-4) : CHECK_IN_ARRAY(pots9X, index-4)); } QString RotaryEncoderString(int index) @@ -242,10 +242,13 @@ QString RawSource::toString() } switch (type) { case SOURCE_TYPE_VIRTUAL_INPUT: - if (model && strlen(model->inputNames[index]) > 0) - return QString(model->inputNames[index]); - else - return QObject::tr("Input %1").arg(index+1); + { + QString result = QObject::tr("[I%1]").arg(index+1); + if (model && strlen(model->inputNames[index]) > 0) { + result += QString(model->inputNames[index]); + } + return result; + } case SOURCE_TYPE_STICK: return AnalogString(index); case SOURCE_TYPE_TRIM: @@ -316,7 +319,8 @@ QString RawSwitch::toString() static const QString multiposPots[] = { QObject::tr("S11"), QObject::tr("S12"), QObject::tr("S13"), QObject::tr("S14"), QObject::tr("S15"), QObject::tr("S16"), - QObject::tr("S21"), QObject::tr("S22"), QObject::tr("S23"), QObject::tr("S24"), QObject::tr("S25"), QObject::tr("S26") + QObject::tr("S21"), QObject::tr("S22"), QObject::tr("S23"), QObject::tr("S24"), QObject::tr("S25"), QObject::tr("S26"), + QObject::tr("S31"), QObject::tr("S32"), QObject::tr("S33"), QObject::tr("S34"), QObject::tr("S35"), QObject::tr("S36") }; static const QString trimsSwitches[] = { @@ -791,7 +795,8 @@ GeneralSettings::GeneralSettings() int potsnum=GetEepromInterface()->getCapability(Pots); if (t_calib.isEmpty()) { return; - } else { + } + else { QString t_trainercalib=g.profile[g.id()].trainerCalib(); int8_t t_vBatCalib=(int8_t)g.profile[g.id()].vBatCalib(); int8_t t_currentCalib=(int8_t)g.profile[g.id()].currentCalib(); @@ -887,11 +892,30 @@ GeneralSettings::GeneralSettings() } +RawSource GeneralSettings::getDefaultSource(unsigned int channel) +{ + unsigned int stick_index = chout_ar[4*templateSetup + channel] - 1; + return RawSource(SOURCE_TYPE_STICK, stick_index); +} + ModelData::ModelData() { clear(); } +ExpoData * ModelData::insertInput(const int idx) +{ + memmove(&expoData[idx+1], &expoData[idx], (C9X_MAX_EXPOS-(idx+1))*sizeof(ExpoData)); + expoData[idx].clear(); + return &expoData[idx]; +} + +void ModelData::removeInput(const int idx) +{ + memmove(&expoData[idx], &expoData[idx+1], (C9X_MAX_EXPOS-(idx+1))*sizeof(ExpoData)); + expoData[C9X_MAX_EXPOS-1].clear(); +} + void ModelData::clearInputs() { for (int i=0; igetBoard(); + int board = GetEepromInterface()->getBoard(); if (IS_TARANIS(board)) { moduleData[0].protocol=PXX_XJT_X16; moduleData[1].protocol=OFF; @@ -947,12 +971,38 @@ bool ModelData::isempty() return !used; } -void ModelData::setDefault(uint8_t id) +void ModelData::setDefaultMixes(GeneralSettings & settings) +{ + if (IS_TARANIS(GetEepromInterface()->getBoard())) { + for (int i=0; ichn = i; + expo->mode = INPUT_MODE_BOTH; + expo->srcRaw = settings.getDefaultSource(i); + expo->weight = 100; + strncpy(inputNames[i], expo->srcRaw.toString().toLatin1().constData(), sizeof(inputNames[i])-1); + MixData * mix = &mixData[i]; + mix->destCh = i+1; + mix->weight = 100; + mix->srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i, this); + } + } + else { + for (int i=0; i template setup, Second is relevant channel out -1,2,3,4 , 1,2,4,3 , 1,3,2,4 , 1,3,4,2 , 1,4,2,3 , 1,4,3,2, -2,1,3,4 , 2,1,4,3 , 2,3,1,4 , 2,3,4,1 , 2,4,1,3 , 2,4,3,1, -3,1,2,4 , 3,1,4,2 , 3,2,1,4 , 3,2,4,1 , 3,4,1,2 , 3,4,2,1, -4,1,2,3 , 4,1,3,2 , 4,2,1,3 , 4,2,3,1 , 4,3,1,2 , 4,3,2,1 }; // TODO delete it? + 1,2,3,4 , 1,2,4,3 , 1,3,2,4 , 1,3,4,2 , 1,4,2,3 , 1,4,3,2, + 2,1,3,4 , 2,1,4,3 , 2,3,1,4 , 2,3,4,1 , 2,4,1,3 , 2,4,3,1, + 3,1,2,4 , 3,1,4,2 , 3,2,1,4 , 3,2,4,1 , 3,4,1,2 , 3,4,2,1, + 4,1,2,3 , 4,1,3,2 , 4,2,1,3 , 4,2,3,1 , 4,3,1,2 , 4,3,2,1 +}; // TODO delete it? // Beep center bits #define BC_BIT_RUD (0x01) @@ -159,10 +160,8 @@ enum HeliSwashTypes { #define NUM_STICKS 4 #define BOARD_9X_NUM_POTS 3 -#define BOARD_X9D_NUM_POTS 4 -#define C9X_NUM_POTS 4 +#define C9X_NUM_POTS 5 #define NUM_CAL_PPM 4 -#define NUM_PPM(board) (IS_ARM(board) ? 16 : 8) #define NUM_CYC 3 #define C9X_NUM_SWITCHES 10 #define C9X_NUM_KEYS 6 @@ -402,6 +401,9 @@ enum BeeperMode { class GeneralSettings { public: GeneralSettings(); + + RawSource getDefaultSource(unsigned int channel); + unsigned int version; unsigned int variant; int calibMid[NUM_STICKS+C9X_NUM_POTS]; @@ -439,7 +441,7 @@ class GeneralSettings { unsigned int backlightDelay; bool blightinv; bool stickScroll; - unsigned int templateSetup; //RETA order according to chout_ar array // TODO enum + unsigned int templateSetup; //RETA order according to chout_ar array int PPM_Multiplier; int hapticLength; unsigned int reNavigation; @@ -504,12 +506,19 @@ class CurveReference { QString toString(); }; +enum InputMode { + INPUT_MODE_NONE, + INPUT_MODE_POS, + INPUT_MODE_NEG, + INPUT_MODE_BOTH +}; + class ExpoData { public: ExpoData() { clear(); } RawSource srcRaw; unsigned int scale; - unsigned int mode; // 0=end, 1=pos, 2=neg, 3=both + unsigned int mode; unsigned int chn; RawSwitch swtch; unsigned int phases; // -5=!FP4, 0=normal, 5=FP4 @@ -882,6 +891,10 @@ class ScriptData { class ModelData { public: ModelData(); + + ExpoData * insertInput(const int idx); + void removeInput(const int idx); + bool used; char name[12+1]; uint8_t modelVoice; @@ -937,7 +950,8 @@ class ModelData { void clear(); bool isempty(); - void setDefault(uint8_t id); + void setDefaultMixes(GeneralSettings & settings); + void setDefaultValues(unsigned int id, GeneralSettings & settings); int getTrimValue(int phaseIdx, int trimIdx); void setTrimValue(int phaseIdx, int trimIdx, int value); @@ -1063,6 +1077,7 @@ enum Capability { GetThrSwitch, HasDisplayText, VirtualInputs, + TrainerInputs, LuaInputs, LimitsPer1000, EnhancedCurves, diff --git a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp index 13db450d7..f147e1fc5 100644 --- a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp +++ b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp @@ -148,7 +148,7 @@ inline int geteepromsize() { #include "radio/src/lua/src/lcorolib.c" -int16_t g_anas[NUM_STICKS+BOARD_X9D_NUM_POTS]; +int16_t g_anas[NUM_STICKS+5]; uint16_t anaIn(uint8_t chan) { diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 5be9f0917..8a9744bc0 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -11,7 +11,7 @@ #define HAS_PERSISTENT_TIMERS(board) (IS_ARM(board) || board == BOARD_GRUVIN9X) #define HAS_LARGE_LCD(board) IS_TARANIS(board) #define MAX_VIEWS(board) (HAS_LARGE_LCD(board) ? 2 : 256) -#define MAX_POTS(board) (IS_TARANIS(board) ? 4 : 3) +#define MAX_POTS(board, version) (IS_TARANIS(board) ? (version>=216 ? 5 : 4) : 3) #define MAX_SWITCHES(board) (IS_TARANIS(board) ? 8 : 7) #define MAX_SWITCHES_POSITION(board) (IS_TARANIS(board) ? 22 : 9) #define MAX_ROTARY_ENCODERS(board) (board==BOARD_GRUVIN9X ? 2 : (board==BOARD_SKY9X ? 1 : 0)) @@ -60,8 +60,8 @@ class SwitchesConversionTable: public ConversionTable { addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++); } - if (version >= 216) { - for (int i=1; i<=GetEepromInterface()->getCapability(MultiposPots) * GetEepromInterface()->getCapability(MultiposPotsPositions); i++) { + if (IS_TARANIS(board) && version >= 216) { + for (int i=1; i<=3*6; i++) { addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i), -val+offset); addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i), val++); } @@ -172,7 +172,7 @@ class SourcesConversionTable: public ConversionTable { } } - for (int i=0; i<4+MAX_POTS(board); i++) + for (int i=0; i<4+MAX_POTS(board, version); i++) addConversion(RawSource(SOURCE_TYPE_STICK, i), val++); for (int i=0; i= 216) { internalField.Append(new UnsignedField<8>(_destCh)); @@ -878,6 +879,14 @@ class MixField: public TransformedField { virtual void afterImport() { + if (IS_TARANIS(board) || version < 216) { + if (mix.srcRaw.type == SOURCE_TYPE_STICK && mix.srcRaw.index < NUM_STICKS) { + if (!mix.noExpo) { + mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, mix.srcRaw.index, model); + } + } + } + if (mix.srcRaw.type != SOURCE_TYPE_NONE) { mix.destCh = _destCh + 1; if (!IS_ARM(board) || version < 216) { @@ -908,6 +917,7 @@ class MixField: public TransformedField { MixData & mix; BoardEnum board; unsigned int version; + ModelData * model; unsigned int _destCh; bool _curveMode; int _curveParam; @@ -917,11 +927,11 @@ class MixField: public TransformedField { unsigned int _offsetMode; }; -class ExpoField: public TransformedField { +class InputField: public TransformedField { public: - ExpoField(ExpoData & expo, BoardEnum board, unsigned int version): + InputField(ExpoData & expo, BoardEnum board, unsigned int version): TransformedField(internalField), - internalField("Expo"), + internalField("Input"), expo(expo), board(board), version(version) @@ -940,11 +950,11 @@ class ExpoField: public TransformedField { internalField.Append(new SpareBitsField<8>()); } else if (IS_ARM(board)) { - internalField.Append(new UnsignedField<8>(expo.mode)); - internalField.Append(new UnsignedField<8>(expo.chn)); + internalField.Append(new UnsignedField<8>(expo.mode, "Mode")); + internalField.Append(new UnsignedField<8>(expo.chn, "Channel")); internalField.Append(new SwitchField<8>(expo.swtch, board, version)); - internalField.Append(new UnsignedField<16>(expo.phases)); - internalField.Append(new SignedField<8>(_weight)); + internalField.Append(new UnsignedField<16>(expo.phases, "Phases")); + internalField.Append(new SignedField<8>(_weight, "Weight")); internalField.Append(new BoolField<8>(_curveMode)); if (HAS_LARGE_LCD(board)) { internalField.Append(new ZCharField<8>(expo.name)); @@ -979,6 +989,7 @@ class ExpoField: public TransformedField { virtual void beforeExport() { _weight = smallGvarToEEPROM(expo.weight); + if (!IS_TARANIS(board) || version < 216) { if (expo.curve.type==CurveReference::CURVE_REF_FUNC && expo.curve.value) { _curveMode = true; @@ -998,7 +1009,9 @@ class ExpoField: public TransformedField { virtual void afterImport() { if (IS_TARANIS(board) && version < 216) { - expo.srcRaw = RawSource(SOURCE_TYPE_STICK, expo.chn); + if (expo.mode) { + expo.srcRaw = RawSource(SOURCE_TYPE_STICK, expo.chn); + } } expo.weight = smallGvarToC9x(_weight); @@ -1091,7 +1104,7 @@ class CurvesField: public TransformedField { CurveData *curve = &curves[i]; int size = (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count); if (offset+size > maxPoints) { - EEPROMWarnings += ::QObject::tr("openTx only accepts %1 points in all curves").arg(maxPoints) + "\n"; + EEPROMWarnings += ::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints) + "\n"; break; } if (!IS_TARANIS(board) || version < 216) { @@ -1128,6 +1141,16 @@ class CurvesField: public TransformedField { } } + if (curve->count > 17) { + qDebug() << "Wrong points count" << curve->count; + curve->count = 0; + for (int j=0; jclear(5); + } + return; + } + for (int j=0; jcount; j++) { curve->points[j].y = *cur++; } @@ -1268,13 +1291,14 @@ class AndSwitchesConversionTable: public ConversionTable { class LogicalSwitchField: public TransformedField { public: - LogicalSwitchField(LogicalSwitchData & csw, BoardEnum board, unsigned int version, unsigned int variant): + LogicalSwitchField(LogicalSwitchData & csw, BoardEnum board, unsigned int version, unsigned int variant, ModelData * model=NULL): TransformedField(internalField), internalField("LogicalSwitch"), csw(csw), board(board), version(version), variant(variant), + model(model), functionsConversionTable(board, version), sourcesConversionTable(SourcesConversionTable::getInstance(board, version, variant, (version >= 214 || (!IS_ARM(board) && version >= 213)) ? 0 : FLAG_NOSWITCHES)), switchesConversionTable(SwitchesConversionTable::getInstance(board, version)), @@ -1364,7 +1388,7 @@ class LogicalSwitchField: public TransformedField { else if (csw.func != LS_FN_OFF) { sourcesConversionTable->importValue((uint8_t)v1, csw.val1); csw.val2 = v2; - RawSource val1(csw.val1); + RawSource val1(csw.val1, model); if (IS_ARM(board) && version < 216 && val1.type == SOURCE_TYPE_TELEMETRY) { switch (val1.index) { case TELEMETRY_SOURCE_TIMER1: @@ -1416,6 +1440,7 @@ class LogicalSwitchField: public TransformedField { BoardEnum board; unsigned int version; unsigned int variant; + ModelData * model; LogicalSwitchesFunctionsTable functionsConversionTable; SourcesConversionTable * sourcesConversionTable; SwitchesConversionTable * switchesConversionTable; @@ -2133,11 +2158,12 @@ class MavlinkField: public StructField { int exportPpmDelay(int delay) { return (delay - 300) / 50; } int importPpmDelay(int delay) { return 300 + 50 * delay; } -Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, unsigned int version, unsigned int variant): +OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigned int version, unsigned int variant): TransformedField(internalField), internalField("ModelData"), modelData(modelData), board(board), + version(version), variant(variant), protocolsConversionTable(board) { @@ -2227,14 +2253,14 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u internalField.Append(new UnsignedField<8>(modelData.beepANACenter)); for (int i=0; imode == INPUT_MODE_BOTH && expo->chn == i && expo->phases == 0 && expo->swtch.type == SWITCH_TYPE_NONE) + break; + if (expo->mode == 0 || expo->chn > i) { + ExpoData * newExpo = modelData.insertInput(j); + newExpo->mode = INPUT_MODE_BOTH; + newExpo->srcRaw = RawSource(SOURCE_TYPE_STICK, i); + newExpo->chn = i; + newExpo->weight = 100; + break; + } + } + strncpy(modelData.inputNames[i], AnalogString(i).toLatin1().constData(), sizeof(modelData.inputNames[i])-1); + } + } + for (int module=0; module<3; module++) { if (modelData.moduleData[module].protocol == PXX_XJT_X16 || modelData.moduleData[module].protocol == LP45) { if (subprotocols[module] >= 0) @@ -2374,13 +2419,13 @@ void Open9xModelDataNew::afterImport() } } -Open9xGeneralDataNew::Open9xGeneralDataNew(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant): +OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant): TransformedField(internalField), internalField("General Settings"), generalData(generalData), board(board), version(version), - inputsCount(IS_TARANIS(board) ? 8 : 7) + inputsCount(4 + MAX_POTS(board, version)) { generalData.version = version; generalData.variant = variant; @@ -2511,18 +2556,18 @@ Open9xGeneralDataNew::Open9xGeneralDataNew(GeneralSettings & generalData, BoardE } } -void Open9xGeneralDataNew::beforeExport() +void OpenTxGeneralData::beforeExport() { uint16_t sum = 0; if (version >= 216) { int count = 0; for (int i=0; i(model, data, index); } else { - return loadModelVariant(index, model, data, version, variant); + return loadModelVariant(index, model, data, version, variant); } } else if (version >= 213) { - return loadModelVariant(index, model, data, version, variant); + return loadModelVariant(index, model, data, version, variant); } std::cout << " ko\n"; @@ -336,7 +336,7 @@ bool OpenTxInterface::load(RadioData &radioData, const uint8_t *eeprom, int size return false; } - if (!loadGeneral(radioData.generalSettings, version)) { + if (!loadGeneral(radioData.generalSettings, version)) { std::cout << " ko\n"; return false; } @@ -383,14 +383,14 @@ int OpenTxInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t varian variant |= M128_VARIANT; } - int result = saveGeneral(radioData.generalSettings, board, version, variant); + int result = saveGeneral(radioData.generalSettings, board, version, variant); if (!result) { return 0; } for (int i=0; i(i, radioData.models[i], version, variant); + result = saveModel(i, radioData.models[i], version, variant); if (!result) { return 0; } @@ -417,7 +417,7 @@ int OpenTxInterface::getSize(ModelData &model) uint8_t tmp[EESIZE_RLC_MAX]; efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board); - Open9xModelDataNew open9xModel(model, board, 255, GetCurrentFirmwareVariant()); + OpenTxModelData open9xModel(model, board, 255, GetCurrentFirmwareVariant()); QByteArray eeprom; open9xModel.Export(eeprom); @@ -436,7 +436,7 @@ int OpenTxInterface::getSize(GeneralSettings &settings) uint8_t tmp[EESIZE_RLC_MAX]; efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board); - Open9xGeneralDataNew open9xGeneral(settings, board, 255, GetCurrentFirmwareVariant()); + OpenTxGeneralData open9xGeneral(settings, board, 255, GetCurrentFirmwareVariant()); // open9xGeneral.Dump(); QByteArray eeprom; @@ -511,7 +511,7 @@ int OpenTxInterface::getCapability(const Capability capability) else return 0; case Pots: - return (IS_TARANIS(board) ? 4 : 3); + return (IS_TARANIS(board) ? 5 : 3); case Switches: return (IS_TARANIS(board) ? 8 : 7); case SwitchesPositions: @@ -671,6 +671,8 @@ int OpenTxInterface::getCapability(const Capability capability) case HasDisplayText: case VirtualInputs: return IS_TARANIS(board) ? 32 : 0; + case TrainerInputs: + return IS_ARM(board) ? 16 : 8; case LuaInputs: case LimitsPer1000: case EnhancedCurves: @@ -681,7 +683,7 @@ int OpenTxInterface::getCapability(const Capability capability) case HasMahPersistent: return (IS_ARM(board) ? true : false); case MultiposPots: - return IS_TARANIS(board) ? 2 : 0; + return IS_TARANIS(board) ? 3 : 0; case MultiposPotsPositions: return IS_TARANIS(board) ? 6 : 0; case SimulatorVariant: diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index 5c9ca7fbd..536921de1 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -599,7 +599,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData & if (item == source) b->setCurrentIndex(b->count()-1); } - for (int i=0; igetBoard()); i++) { + for (int i=0; igetCapability(TrainerInputs); i++) { item = RawSource(SOURCE_TYPE_PPM, i); b->addItem(item.toString(), item.toValue()); if (item == source) b->setCurrentIndex(b->count()-1); diff --git a/companion/src/mdichild.cpp b/companion/src/mdichild.cpp index 91a5ba3e1..3af585369 100644 --- a/companion/src/mdichild.cpp +++ b/companion/src/mdichild.cpp @@ -155,7 +155,7 @@ void MdiChild::OpenEditWindow(bool wizard=false) ModelData &model = radioData.models[row - 1]; if (model.isempty()) { - model.setDefault(row - 1); + model.setDefaultValues(row - 1, radioData.generalSettings); isNew = true; //modeledit - clear mixes, apply first template setModified(); } diff --git a/companion/src/modeledit/inputs.cpp b/companion/src/modeledit/inputs.cpp index c140585ee..a6e1f6eac 100644 --- a/companion/src/modeledit/inputs.cpp +++ b/companion/src/modeledit/inputs.cpp @@ -29,9 +29,9 @@ InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & g exposLayout->addWidget(qbClear,2,2); exposLayout->addWidget(qbDown,2,3); - connect(ExposlistWidget, SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(expolistWidget_customContextMenuRequested(QPoint))); - connect(ExposlistWidget, SIGNAL(doubleClicked(QModelIndex)),this,SLOT(expolistWidget_doubleClicked(QModelIndex))); - connect(ExposlistWidget, SIGNAL(mimeDropped(int,const QMimeData*,Qt::DropAction)),this,SLOT(mimeExpoDropped(int,const QMimeData*,Qt::DropAction))); + connect(ExposlistWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(expolistWidget_customContextMenuRequested(QPoint))); + connect(ExposlistWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(expolistWidget_doubleClicked(QModelIndex))); + connect(ExposlistWidget, SIGNAL(mimeDropped(int,const QMimeData*,Qt::DropAction)), this, SLOT(mimeExpoDropped(int, const QMimeData*, Qt::DropAction))); connect(qbUp, SIGNAL(pressed()),SLOT(moveExpoUp())); connect(qbDown, SIGNAL(pressed()),SLOT(moveExpoDown())); @@ -58,7 +58,7 @@ void InputsPanel::update() ExposlistWidget->clear(); int curDest = -1; - for(int i=0; imode==0) break; @@ -144,26 +144,24 @@ void InputsPanel::update() bool InputsPanel::gm_insertExpo(int idx) { - if (idx<0 || idx>=C9X_MAX_EXPOS || model.expoData[C9X_MAX_EXPOS-1].mode > 0) { - QMessageBox::information(this, "companion", tr("Not enough available inputs!")); - return false; - } + if (idx<0 || idx>=C9X_MAX_EXPOS || model.expoData[C9X_MAX_EXPOS-1].mode > 0) { + QMessageBox::information(this, "Companion", tr("Not enough available inputs!")); + return false; + } - int chn = model.expoData[idx].chn; - memmove(&model.expoData[idx+1],&model.expoData[idx], - (C9X_MAX_EXPOS-(idx+1))*sizeof(ExpoData) ); - memset(&model.expoData[idx],0,sizeof(ExpoData)); - model.expoData[idx].chn = chn; - model.expoData[idx].weight = 100; - model.expoData[idx].mode = 3 /* TODO enum */; - return true; + int chn = model.expoData[idx].chn; + + ExpoData * newExpo = model.insertInput(idx); + newExpo->chn = chn; + newExpo->weight = 100; + newExpo->mode = INPUT_MODE_BOTH; + + return true; } void InputsPanel::gm_deleteExpo(int index) { - memmove(&model.expoData[index],&model.expoData[index+1], - (C9X_MAX_EXPOS-(index+1))*sizeof(ExpoData)); - memset(&model.expoData[C9X_MAX_EXPOS-1],0,sizeof(ExpoData)); + model.removeInput(index); } void InputsPanel::gm_openExpo(int index) diff --git a/companion/src/modeledit/mixerslist.h b/companion/src/modeledit/mixerslist.h index 01b225a39..52e9ffebb 100644 --- a/companion/src/modeledit/mixerslist.h +++ b/companion/src/modeledit/mixerslist.h @@ -6,24 +6,19 @@ class MixersList : public QListWidget { Q_OBJECT -public: - explicit MixersList(QWidget *parent, bool expo); -// QMimeData * mimeData ( const QList items ); + public: + explicit MixersList(QWidget *parent, bool expo); void keyPressEvent(QKeyEvent *event); - -signals: + signals: void mimeDropped(int index, const QMimeData *data, Qt::DropAction action); void keyWasPressed(QKeyEvent *event); - -protected: - -public slots: + public slots: bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action); -private: + private: QPoint dragStartPosition; bool expo; diff --git a/companion/src/modeledit/mixes.cpp b/companion/src/modeledit/mixes.cpp index ed6016e57..df92f5ecb 100644 --- a/companion/src/modeledit/mixes.cpp +++ b/companion/src/modeledit/mixes.cpp @@ -53,15 +53,16 @@ void MixesPanel::update() int i; unsigned int outputs = GetEepromInterface()->getCapability(Outputs); int showNames = false; // TODO in a menu ui->showNames_Ckb->isChecked(); - for(i=0; igetCapability(Mixes); i++) { + for (i=0; igetCapability(Mixes); i++) { MixData *md = &model.mixData[i]; if ((md->destCh==0) || (md->destCh>outputs+(unsigned int)GetEepromInterface()->getCapability(ExtraChannels))) continue; QString str = ""; - while(curDest<(md->destCh-1)) { + while (curDest<(md->destCh-1)) { curDest++; if (curDest > outputs) { str = tr("X%1 ").arg(curDest-outputs); - } else { + } + else { str = tr("CH%1%2").arg(curDest/10).arg(curDest%10); if (GetEepromInterface()->getCapability(HasChNames) && showNames) { QString name=model.limitData[curDest-1].name; @@ -80,7 +81,8 @@ void MixesPanel::update() if (md->destCh > outputs) { str = tr("X%1 ").arg(md->destCh-outputs); - } else { + } + else { str = tr("CH%1%2").arg(md->destCh/10).arg(md->destCh%10); str.append(" "); if (GetEepromInterface()->getCapability(HasChNames) && showNames) { @@ -97,7 +99,7 @@ void MixesPanel::update() str.fill(' '); } - switch(md->mltpx) { + switch (md->mltpx) { case (1): str += " *"; break; case (2): str += " R"; break; default: str += " "; break; @@ -110,7 +112,9 @@ void MixesPanel::update() QString phasesStr = getPhasesStr(md->phases, model); if (!phasesStr.isEmpty()) str += " " + phasesStr; - if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch(%1)").arg(md->swtch.toString()); + if (md->swtch.type != SWITCH_TYPE_NONE) { + str += " " + tr("Switch(%1)").arg(md->swtch.toString()); + } if (!GetEepromInterface()->getCapability(VirtualInputs)) { if (md->carryTrim>0) { @@ -125,9 +129,9 @@ void MixesPanel::update() if (md->sOffset) str += " " + tr("Offset(%1)").arg(getGVarString(md->sOffset)); if (md->curve.value) str += " " + md->curve.toString(); - int scale=GetEepromInterface()->getCapability(SlowScale); - if (scale==0) - scale=1; + int scale = GetEepromInterface()->getCapability(SlowScale); + if (scale == 0) + scale = 1; if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale); if (md->speedDown || md->speedUp) @@ -144,8 +148,8 @@ void MixesPanel::update() qba.append((quint8)i); qba.append((const char*)md, sizeof(MixData)); QListWidgetItem *itm = new QListWidgetItem(str); - itm->setData(Qt::UserRole,qba); // mix number - MixerlistWidget->addItem(itm);//(str); + itm->setData(Qt::UserRole, qba); // mix number + MixerlistWidget->addItem(itm); //(str); } while(curDestgetCapability(ExtraChannels)) { diff --git a/companion/src/modelslist.cpp b/companion/src/modelslist.cpp index 088945f12..d6e72b219 100644 --- a/companion/src/modelslist.cpp +++ b/companion/src/modelslist.cpp @@ -44,36 +44,36 @@ #include "helpers.h" class DragDropHeader { -public: - DragDropHeader(): - general_settings(false), - models_count(0) - { - } - bool general_settings; - uint8_t models_count; - uint8_t models[C9X_MAX_MODELS]; + public: + DragDropHeader(): + general_settings(false), + models_count(0) + { + } + bool general_settings; + uint8_t models_count; + uint8_t models[C9X_MAX_MODELS]; }; ModelsListWidget::ModelsListWidget(QWidget *parent): QListWidget(parent) { - this->setFont(QFont("Courier New",12)); - radioData = &((MdiChild *)parent)->radioData; - refreshList(); + setFont(QFont("Courier New",12)); + radioData = &((MdiChild *)parent)->radioData; + refreshList(); - connect(this, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(OpenEditWindow())); - connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowContextMenu(const QPoint&))); - connect(this, SIGNAL(currentRowChanged(int)), this, SLOT(viableModelSelected(int))); + connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(OpenEditWindow())); + connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowContextMenu(const QPoint&))); + connect(this, SIGNAL(currentRowChanged(int)), this, SLOT(viableModelSelected(int))); - setContextMenuPolicy(Qt::CustomContextMenu); - setSelectionMode(QAbstractItemView::ExtendedSelection); - setDragEnabled(true); - setAcceptDrops(true); - setDragDropOverwriteMode(true); - setDropIndicatorShown(true); + setContextMenuPolicy(Qt::CustomContextMenu); + setSelectionMode(QAbstractItemView::ExtendedSelection); + setDragEnabled(true); + setAcceptDrops(true); + setDragDropOverwriteMode(true); + setDropIndicatorShown(true); - active_highlight_color = this->palette().color(QPalette::Active, QPalette::Highlight); + active_highlight_color = palette().color(QPalette::Active, QPalette::Highlight); } void ModelsListWidget::ShowContextMenu(const QPoint& pos) diff --git a/radio/src/audio_arm.cpp b/radio/src/audio_arm.cpp index 96a8514d4..36f11d17e 100644 --- a/radio/src/audio_arm.cpp +++ b/radio/src/audio_arm.cpp @@ -381,7 +381,7 @@ void referenceModelAudioFiles() } // Switches Audio Files -[up|mid|down].wav - for (int i=0; i 0) source += MAX_INPUTS + MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS; + // S3 added + if (source > MIXSRC_POT2) + source += 1; // PPM9-PPM16 added if (source > MIXSRC_FIRST_PPM+7) source += 8; @@ -290,7 +358,7 @@ int ConvertSwitch_215_to_216(int swtch) else if (swtch <= SWSRC_LAST_SWITCH) return swtch; else - return swtch + (2*4) + (2*6); // 4 trims and 2 * 6-pos added as switches + return swtch + (2*4) + (3*6); // 4 trims and 2 * 6-pos added as switches } #else int ConvertSource_215_to_216(int source, bool insertZero=false) diff --git a/radio/src/gui/menu_general.cpp b/radio/src/gui/menu_general.cpp index 87200d5d8..5f2ade988 100644 --- a/radio/src/gui/menu_general.cpp +++ b/radio/src/gui/menu_general.cpp @@ -1154,7 +1154,7 @@ void menuGeneralDiagAna(uint8_t event) #if defined(PCBTARANIS) lcd_putsLeft(6*FH+1, STR_BATT_CALIB); static int32_t adcBatt; - adcBatt = ((adcBatt * 7) + anaIn(8)) / 8; + adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8; uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.vBatCalib)/128) * BATT_SCALE; batCalV >>= 11; batCalV += 2; // because of the diode @@ -1162,7 +1162,7 @@ void menuGeneralDiagAna(uint8_t event) #elif defined(PCBSKY9X) lcd_putsLeft(5*FH+1, STR_BATT_CALIB); static int32_t adcBatt; - adcBatt = ((adcBatt * 7) + anaIn(7)) / 8; + adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8; uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128) * 4191; batCalV /= 55296; putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 5*FH+1, batCalV, (m_posVert==1 ? INVERS : 0)); @@ -1170,7 +1170,7 @@ void menuGeneralDiagAna(uint8_t event) lcd_putsLeft(6*FH-2, STR_BATT_CALIB); // Gruvin wants 2 decimal places and instant update of volts calib field when button pressed static uint16_t adcBatt; - adcBatt = ((adcBatt * 7) + anaIn(7)) / 8; // running average, sourced directly (to avoid unending debate :P) + adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8; // running average, sourced directly (to avoid unending debate :P) uint32_t batCalV = ((uint32_t)adcBatt*1390 + (10*(int32_t)adcBatt*g_eeGeneral.vBatCalib)/8) / BandGap; lcd_outdezNAtt(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, batCalV, PREC2|(m_posVert==1 ? INVERS : 0)); #else @@ -1196,6 +1196,7 @@ void menuGeneralDiagAna(uint8_t event) enum menuGeneralHwItems { ITEM_SETUP_HW_POT1, ITEM_SETUP_HW_POT2, + ITEM_SETUP_HW_POT3, ITEM_SETUP_HW_UART3_MODE, ITEM_SETUP_HW_MAX }; @@ -1214,14 +1215,20 @@ void menuGeneralHardware(uint8_t event) switch(i) { case ITEM_SETUP_HW_POT1: case ITEM_SETUP_HW_POT2: + case ITEM_SETUP_HW_POT3: { int idx = i - ITEM_SETUP_HW_POT1; - uint8_t mask = (1<> idx, 0, 1, attr, event); - if (potType) - g_eeGeneral.potsType |= mask; - else - g_eeGeneral.potsType &= ~mask; + uint8_t shift = (2*idx); + uint8_t mask = (0x03 << shift); + putsMixerSource(sizeof(TR_TYPE)*FW, y, MIXSRC_FIRST_POT+idx); + uint8_t potType = (g_eeGeneral.potsType & mask) >> shift; + if (potType == POT_TYPE_NONE && i < 2) + potType = 1; + potType = selectMenuItem(HW_SETTINGS_COLUMN, y, STR_TYPE, STR_POTTYPES, potType, 0, POT_TYPE_MAX, attr, event); + if (potType == POT_TYPE_POT && i < 2) + potType = 0; + g_eeGeneral.potsType &= ~mask; + g_eeGeneral.potsType |= (potType << shift); break; } @@ -1234,7 +1241,6 @@ void menuGeneralHardware(uint8_t event) } } - } #elif defined(PCBSKY9X) @@ -1323,7 +1329,7 @@ void menuCommonCalib(uint8_t event) #if defined(PCBTARANIS) uint8_t idx = i - POT1; int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount; - if (IS_MULTIPOS_POT(i) && count <= POTS_POS_COUNT) { + if (IS_POT_MULTIPOS(i) && count <= XPOTS_MULTIPOS_COUNT) { if (reusableBuffer.calib.xpotsCalib[idx].lastCount == 0 || vt < reusableBuffer.calib.xpotsCalib[idx].lastPosition - XPOT_DELTA || vt > reusableBuffer.calib.xpotsCalib[idx].lastPosition + XPOT_DELTA) { reusableBuffer.calib.xpotsCalib[idx].lastPosition = vt; reusableBuffer.calib.xpotsCalib[idx].lastCount = 1; @@ -1341,7 +1347,7 @@ void menuCommonCalib(uint8_t event) } } if (!found) { - if (count < POTS_POS_COUNT) { + if (count < XPOTS_MULTIPOS_COUNT) { reusableBuffer.calib.xpotsCalib[idx].steps[count] = position; } reusableBuffer.calib.xpotsCalib[idx].stepsCount += 1; @@ -1413,7 +1419,7 @@ void menuCommonCalib(uint8_t event) for (uint8_t i=POT1; i<=POT_LAST; i++) { int idx = i - POT1; int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount; - if (IS_MULTIPOS_POT(i) && count > 1 && count <= POTS_POS_COUNT) { + if (IS_POT_MULTIPOS(i) && count > 1 && count <= XPOTS_MULTIPOS_COUNT) { for (int j=0; jcount + 1; } - if (steps > 0 && steps <= POTS_POS_COUNT) { + if (steps > 0 && steps <= XPOTS_MULTIPOS_COUNT) { lcd_outdezAtt(LCD_W/2-2+(i-POT1)*5, LCD_H-6, steps, TINSIZE); } } diff --git a/radio/src/gui/menus.cpp b/radio/src/gui/menus.cpp index 997f6e984..70ceb4412 100644 --- a/radio/src/gui/menus.cpp +++ b/radio/src/gui/menus.cpp @@ -1351,6 +1351,12 @@ bool isSourceAvailable(int source) return false; #endif +#if defined(PCBTARANIS) + if (source>=MIXSRC_FIRST_POT && source<=MIXSRC_LAST_POT) { + return IS_POT_AVAILABLE(POT1+source-MIXSRC_FIRST_POT); + } +#endif + #if !defined(HELI) if (source>=MIXSRC_CYC1 && source<=MIXSRC_CYC3) return false; @@ -1438,11 +1444,11 @@ bool isSwitchAvailableInLogicalSwitches(int swtch) } #if defined(PCBTARANIS) - if (swtch >= SWSRC_P11 && swtch <= SWSRC_P26) { - int index = (swtch - SWSRC_P11) / POTS_POS_COUNT; - if (g_eeGeneral.potsType & (1<= SWSRC_FIRST_MULTIPOS_SWITCH && swtch <= SWSRC_LAST_MULTIPOS_SWITCH) { + int index = (swtch - SWSRC_FIRST_MULTIPOS_SWITCH) / XPOTS_MULTIPOS_COUNT; + if (IS_POT_MULTIPOS(POT1+index)) { StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[POT1+index]; - return (calib->count >= ((swtch - SWSRC_P11) % POTS_POS_COUNT)); + return (calib->count >= ((swtch - SWSRC_FIRST_MULTIPOS_SWITCH) % XPOTS_MULTIPOS_COUNT)); } else { return false; diff --git a/radio/src/gui/view_main.cpp b/radio/src/gui/view_main.cpp index 1cebc93c3..4c373e18c 100644 --- a/radio/src/gui/view_main.cpp +++ b/radio/src/gui/view_main.cpp @@ -122,8 +122,10 @@ void drawPotsBars() // Optimization by Mike Blandford uint8_t x, i, len ; // declare temporary variables for (x=LCD_W/2-5, i=NUM_STICKS; iNUM_STICKS+1 ? LCD_H/2+1 : 1); + if (i == POT3) { + continue; + } + xcoord_t x = ((i==POT1 || i==SLIDER1) ? 3 : LCD_W-5); + int8_t y = (i>=SLIDER1 ? LCD_H/2+1 : 1); lcd_vline(x, y, LCD_H/2-2); lcd_vline(x+1, y, LCD_H/2-2); y += LCD_H/2-4; diff --git a/radio/src/logs.cpp b/radio/src/logs.cpp index cb9ecb697..99ad03d98 100644 --- a/radio/src/logs.cpp +++ b/radio/src/logs.cpp @@ -153,7 +153,7 @@ const pm_char * openLogs() #endif #if defined(PCBTARANIS) - f_puts("Rud,Ele,Thr,Ail,S1,S2,LS,RS,SA,SB,SC,SD,SE,SF,SG,SH\n", &g_oLogFile); + f_puts("Rud,Ele,Thr,Ail,S1,S2,S3,LS,RS,SA,SB,SC,SD,SE,SF,SG,SH\n", &g_oLogFile); #else f_puts("Rud,Ele,Thr,Ail,P1,P2,P3,THR,RUD,ELE,3POS,AIL,GEA,TRN\n", &g_oLogFile); #endif diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 881d5a5c4..ba722512f 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -68,52 +68,62 @@ #endif #if defined(PCBTARANIS) - #define MAX_MODELS 60 - #define NUM_CHNOUT 32 // number of real output channels CH1-CH32 - #define MAX_PHASES 9 - #define MAX_MIXERS 64 - #define MAX_EXPOS 64 - #define NUM_CSW 32 // number of custom switches - #define NUM_CFN 64 // number of functions assigned to switches - #define MAX_SCRIPTS 7 - #define MAX_INPUTS 32 - #define NUM_PPM 16 + #define MAX_MODELS 60 + #define NUM_CHNOUT 32 // number of real output channels CH1-CH32 + #define MAX_PHASES 9 + #define MAX_MIXERS 64 + #define MAX_EXPOS 64 + #define NUM_CSW 32 // number of custom switches + #define NUM_CFN 64 // number of functions assigned to switches + #define MAX_SCRIPTS 7 + #define MAX_INPUTS 32 + #define NUM_PPM 16 + #define NUM_POTS 5 + #define NUM_XPOTS 3 #elif defined(CPUARM) - #define MAX_MODELS 60 - #define NUM_CHNOUT 32 // number of real output channels CH1-CH32 - #define MAX_PHASES 9 - #define MAX_MIXERS 64 - #define MAX_EXPOS 32 - #define NUM_CSW 32 // number of custom switches - #define NUM_CFN 64 // number of functions assigned to switches - #define NUM_PPM 16 + #define MAX_MODELS 60 + #define NUM_CHNOUT 32 // number of real output channels CH1-CH32 + #define MAX_PHASES 9 + #define MAX_MIXERS 64 + #define MAX_EXPOS 32 + #define NUM_CSW 32 // number of custom switches + #define NUM_CFN 64 // number of functions assigned to switches + #define NUM_PPM 16 + #define NUM_POTS 3 + #define NUM_XPOTS 0 #elif defined(CPUM2560) || defined(CPUM2561) - #define MAX_MODELS 30 - #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 - #define MAX_PHASES 6 - #define MAX_MIXERS 32 - #define MAX_EXPOS 16 - #define NUM_CSW 15 // number of custom switches - #define NUM_CFN 24 // number of functions assigned to switches - #define NUM_PPM 8 + #define MAX_MODELS 30 + #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 + #define MAX_PHASES 6 + #define MAX_MIXERS 32 + #define MAX_EXPOS 16 + #define NUM_CSW 15 // number of custom switches + #define NUM_CFN 24 // number of functions assigned to switches + #define NUM_PPM 8 + #define NUM_POTS 3 + #define NUM_XPOTS 0 #elif defined(CPUM128) - #define MAX_MODELS 30 - #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 - #define MAX_PHASES 5 - #define MAX_MIXERS 32 - #define MAX_EXPOS 14 - #define NUM_CSW 15 // number of custom switches - #define NUM_CFN 24 // number of functions assigned to switches - #define NUM_PPM 8 + #define MAX_MODELS 30 + #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 + #define MAX_PHASES 5 + #define MAX_MIXERS 32 + #define MAX_EXPOS 14 + #define NUM_CSW 15 // number of custom switches + #define NUM_CFN 24 // number of functions assigned to switches + #define NUM_PPM 8 + #define NUM_POTS 3 + #define NUM_XPOTS 0 #else - #define MAX_MODELS 16 - #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 - #define MAX_PHASES 5 - #define MAX_MIXERS 32 - #define MAX_EXPOS 14 - #define NUM_CSW 12 // number of custom switches - #define NUM_CFN 16 // number of functions assigned to switches - #define NUM_PPM 8 + #define MAX_MODELS 16 + #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 + #define MAX_PHASES 5 + #define MAX_MIXERS 32 + #define MAX_EXPOS 14 + #define NUM_CSW 12 // number of custom switches + #define NUM_CFN 16 // number of functions assigned to switches + #define NUM_PPM 8 + #define NUM_POTS 3 + #define NUM_XPOTS 0 #endif #define MAX_TIMERS 2 @@ -333,12 +343,12 @@ enum BacklightMode { #define SPLASH_MODE uint8_t splashMode:1; uint8_t spare4:2 #endif -#define POTS_POS_COUNT 6 +#define XPOTS_MULTIPOS_COUNT 6 #if defined(PCBTARANIS) PACK(typedef struct { uint8_t count; - uint8_t steps[POTS_POS_COUNT-1]; + uint8_t steps[XPOTS_MULTIPOS_COUNT-1]; }) StepsCalibData; #endif @@ -1305,10 +1315,8 @@ enum SwitchSources { SWSRC_LAST_SWITCH = SWSRC_TRAINER, #if defined(PCBTARANIS) - SWSRC_P11, - SWSRC_P16 = SWSRC_P11+5, - SWSRC_P21, - SWSRC_P26 = SWSRC_P21+5, + SWSRC_FIRST_MULTIPOS_SWITCH, + SWSRC_LAST_MULTIPOS_SWITCH = SWSRC_FIRST_MULTIPOS_SWITCH + (NUM_XPOTS*XPOTS_MULTIPOS_COUNT) - 1, #endif SWSRC_FIRST_TRIM, @@ -1369,11 +1377,12 @@ enum MixSources { MIXSRC_FIRST_POT, #if defined(PCBTARANIS) - MIXSRC_S1 = MIXSRC_FIRST_POT, - MIXSRC_S2, - MIXSRC_S3, - MIXSRC_S4, - MIXSRC_LAST_POT = MIXSRC_S4, + MIXSRC_POT1 = MIXSRC_FIRST_POT, + MIXSRC_POT2, + MIXSRC_POT3, + MIXSRC_SLIDER1, + MIXSRC_SLIDER2, + MIXSRC_LAST_POT = MIXSRC_SLIDER2, #else MIXSRC_P1 = MIXSRC_FIRST_POT, MIXSRC_P2, diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index e41621775..a8090a9aa 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -520,7 +520,7 @@ uint16_t evalChkSum() { uint16_t sum = 0; const int16_t *calibValues = (const int16_t *) &g_eeGeneral.calib[0]; - for (int i=0; icount>0 && calib->countcount>0 && calib->countcount); uint8_t previousPos = potsPos[i] >> 4; uint8_t previousStoredPos = potsPos[i] & 0x0F; @@ -1416,7 +1416,7 @@ void getSwitchesPosition(bool startup) potsLastposStart[i] = 0; potsPos[i] = (pos << 4) | pos; if (previousStoredPos != pos) { - PLAY_SWITCH_MOVED(SWSRC_LAST_SWITCH+i*POTS_POS_COUNT+pos); + PLAY_SWITCH_MOVED(SWSRC_LAST_SWITCH+i*XPOTS_MULTIPOS_COUNT+pos); } } } @@ -1424,7 +1424,7 @@ void getSwitchesPosition(bool startup) } } #define SWITCH_POSITION(sw) (switchesPos & (1<<(sw))) -#define POT_POSITION(sw) ((potsPos[(sw)/POTS_POS_COUNT] & 0x0f) == ((sw) % POTS_POS_COUNT)) +#define POT_POSITION(sw) ((potsPos[(sw)/XPOTS_MULTIPOS_COUNT] & 0x0f) == ((sw) % XPOTS_MULTIPOS_COUNT)) #else #define getSwitchesPosition(...) #define SWITCH_POSITION(idx) switchState((EnumKeys)(SW_BASE+(idx))) @@ -1464,8 +1464,8 @@ bool getSwitch(int8_t swtch) #endif } #if defined(PCBTARANIS) - else if (cs_idx <= SWSRC_P26) { - result = POT_POSITION(cs_idx-SWSRC_P11); + else if (cs_idx <= SWSRC_LAST_MULTIPOS_SWITCH) { + result = POT_POSITION(cs_idx-SWSRC_FIRST_MULTIPOS_SWITCH); } #endif else if (cs_idx <= SWSRC_LAST_TRIM) { @@ -2821,7 +2821,7 @@ void getADC() #if defined(PCBTARANIS) if (s_noScroll) v = temp[x] >> 1; StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[x]; - if (!s_noScroll && IS_MULTIPOS_POT(x) && calib->count>0 && calib->countcount>0 && calib->count> 4); s_anaFilt[x] = 2*RESX; for (int i=0; icount; i++) { @@ -3084,7 +3084,7 @@ void evalInputs(uint8_t mode) #ifndef SIMU if (i < NUM_STICKS+NUM_POTS) { - if (IS_MULTIPOS_POT(i)) { + if (IS_POT_MULTIPOS(i)) { v -= RESX; } else { diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 0ee4b3bf1..5c86d0dd3 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -378,8 +378,6 @@ enum EnumKeys { #if defined(PCBTARANIS) #define NUM_SWITCHES 8 #define IS_3POS(sw) ((sw) != 5 && (sw) != 7) - #define NUM_POTS 4 - #define NUM_XPOTS 2 #define NUM_SW_SRCRAW 8 #define SWSRC_THR SWSRC_SF2 #define SWSRC_GEA SWSRC_SG2 @@ -391,8 +389,6 @@ enum EnumKeys { #define NUM_SWITCHES 7 #define IS_3POS(sw) ((sw) == 0) #define IS_MOMENTARY(sw) (sw == SWSRC_TRN) - #define NUM_POTS 3 - #define NUM_XPOTS 0 #define NUM_SW_SRCRAW 1 #define SW_DSM2_BIND SW_TRN #endif @@ -413,10 +409,19 @@ enum EnumKeys { #include "myeeprom.h" +enum PotType { + POT_TYPE_NONE, + POT_TYPE_POT, + POT_TYPE_MULTIPOS, + POT_TYPE_MAX=POT_TYPE_MULTIPOS +}; + #if defined(PCBTARANIS) - #define IS_MULTIPOS_POT(x) ((x)>=POT1 && (x)<=POT_LAST && (g_eeGeneral.potsType & (1 << ((x)-POT1)))) + #define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsType & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE) + #define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS) #else - #define IS_MULTIPOS_POT(x) (false) + #define IS_POT_AVAILABLE(x) (true) + #define IS_POT_MULTIPOS(x) (false) #endif #if ROTARY_ENCODERS > 0 @@ -1044,7 +1049,8 @@ enum Analogs { #if defined(PCBTARANIS) POT1, POT2, - POT_LAST = POT2, + POT3, + POT_LAST = POT3, SLIDER1, SLIDER2, #else @@ -1603,7 +1609,7 @@ union ReusableBuffer #if defined(PCBTARANIS) struct { uint8_t stepsCount; - int16_t steps[POTS_POS_COUNT]; + int16_t steps[XPOTS_MULTIPOS_COUNT]; uint8_t lastCount; int16_t lastPosition; } xpotsCalib[NUM_XPOTS]; diff --git a/radio/src/simu.cpp b/radio/src/simu.cpp index 73458e5b0..abe3bd6d4 100644 --- a/radio/src/simu.cpp +++ b/radio/src/simu.cpp @@ -407,18 +407,18 @@ uint16_t anaIn(uint8_t chan) else if (chanknobs[chan-NUM_STICKS]->getValue(); #if defined(PCBTARANIS) - else if (chan == 8) + else if (chan == TX_VOLTAGE) return 1000; #elif defined(PCBSKY9X) - else if (chan == 7) + else if (chan == TX_VOLTAGE) return 1500; - else if (chan == 8) + else if (chan == TX_CURRENT) return 100; #elif defined(PCBGRUVIN9X) - else if (chan == 7) + else if (chan == TX_VOLTAGE) return 150; #else - else if (chan == 7) + else if (chan == TX_VOLTAGE) return 1500; #endif else diff --git a/radio/src/targets/taranis/adc_driver.cpp b/radio/src/targets/taranis/adc_driver.cpp index a57e300bd..12aaea7c9 100644 --- a/radio/src/targets/taranis/adc_driver.cpp +++ b/radio/src/targets/taranis/adc_driver.cpp @@ -60,9 +60,9 @@ volatile uint16_t Analog_values[NUMBER_ANALOG]; #if defined(REV4a) -const char ana_direction[NUMBER_ANALOG] = {0,1,0,1, 1,1,1,0, 0}; +const char ana_direction[NUMBER_ANALOG] = {0,1,0,1, 1,1,0,1,0, 0}; #elif !defined(REV3) -const char ana_direction[NUMBER_ANALOG] = {0,1,0,1, 1,0,1,0, 0}; +const char ana_direction[NUMBER_ANALOG] = {0,1,0,1, 1,0,0,1,0, 0}; #endif void adcInit() @@ -88,7 +88,7 @@ void adcInit() ADC1->CR1 = ADC_CR1_SCAN ; ADC1->CR2 = ADC_CR2_ADON | ADC_CR2_DMA | ADC_CR2_DDS ; ADC1->SQR1 = (NUMBER_ANALOG-1) << 20 ; // NUMBER_ANALOG Channels - ADC1->SQR2 = SLIDE_L + (SLIDE_R<<5) + (BATTERY<<10) ; + ADC1->SQR2 = (SLIDE_L<<5) + (SLIDE_R<<10) + (BATTERY<<15) ; ADC1->SQR3 = STICK_LH + (STICK_LV<<5) + (STICK_RV<<10) + (STICK_RH<<15) + (POT_L<<20) + (POT_R<<25) ; ADC1->SMPR1 = SAMPTIME + (SAMPTIME<<3) + (SAMPTIME<<6) + (SAMPTIME<<9) + (SAMPTIME<<12) + (SAMPTIME<<15) + (SAMPTIME<<18) + (SAMPTIME<<21) + (SAMPTIME<<24) ; @@ -120,7 +120,6 @@ void adcRead() } } DMA2_Stream0->CR &= ~DMA_SxCR_EN ; // Disable DMA - // return ( i < 10000 ) ? 1 : 0 ; #if !defined(REV3) // adc direction correct @@ -136,9 +135,3 @@ void adcRead() void adcStop() { } - - - - - - diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 1eab9c13c..b003a4336 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -498,8 +498,6 @@ const pm_char STR_VIEW_TEXT[] PROGMEM = "View text"; const pm_char STR_POTWARNING[] PROGMEM = TR_POTWARNING; const pm_char STR_CHECKLIST[] PROGMEM = TR_CHECKLIST; const pm_char STR_UART3MODE[] PROGMEM = TR_UART3MODE; - const pm_char STR_POT1TYPE[] PROGMEM = TR_POT1TYPE; - const pm_char STR_POT2TYPE[] PROGMEM = TR_POT2TYPE; #endif #if MENUS_LOCK == 1 diff --git a/radio/src/translations.h b/radio/src/translations.h index 5af831a5c..1f46fcb0a 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -689,8 +689,6 @@ extern const pm_char STR_VIEW_TEXT[]; extern const pm_char STR_POTWARNING[]; extern const pm_char STR_CHECKLIST[]; extern const pm_char STR_UART3MODE[]; - extern const pm_char STR_POT1TYPE[]; - extern const pm_char STR_POT2TYPE[]; #endif #if MENUS_LOCK == 1 diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index fba770450..96504d9a1 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -342,7 +342,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -376,7 +376,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW @@ -718,8 +718,6 @@ #define TR_CHECKLIST "Display Checklist" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") #define TR_UART3MODE "Serial port" -#define TR_POT1TYPE "S1 Type" -#define TR_POT2TYPE "S2 Type" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index b72ebcdb7..10706d1bc 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -344,7 +344,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " //4 Potis S1,S2,Links,Rechts + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " //4 Potis S1,S2,Links,Rechts #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -378,7 +378,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_CUSTOMSW @@ -720,8 +720,6 @@ #define TR_CHECKLIST "Display Checklist" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") #define TR_UART3MODE "Serial Port" -#define TR_POT1TYPE "S1 Type" -#define TR_POT2TYPE "S2 Type" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 93093015e..e99c62650 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -72,7 +72,7 @@ #define TR_UART3MODES "OFF\0 ""S-Port Mirror\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "Pot\0 ""Multipos Switch" +#define TR_POTTYPES "None\0 ""Pot\0 ""Multipos Switch" #define LEN_DATETIME "\005" #define TR_DATETIME "DATE:""TIME:" @@ -352,7 +352,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -386,7 +386,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW @@ -728,8 +728,6 @@ #define TR_CHECKLIST "Display Checklist" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") #define TR_UART3MODE "Serial port" -#define TR_POT1TYPE "S1 Type" -#define TR_POT2TYPE "S2 Type" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 0952ae695..d0a5630cc 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -342,7 +342,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -376,7 +376,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW @@ -718,8 +718,6 @@ #define TR_CHECKLIST "Display Checklist" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") #define TR_UART3MODE "Serial port" -#define TR_POT1TYPE "S1 Type" -#define TR_POT2TYPE "S2 Type" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 08006d948..fca9d388e 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -342,7 +342,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -376,7 +376,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW @@ -718,8 +718,6 @@ #define TR_CHECKLIST "Display Checklist" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") #define TR_UART3MODE "Serial port" -#define TR_POT1TYPE "S1 Type" -#define TR_POT2TYPE "S2 Type" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index f0646a174..d1762df32 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -342,7 +342,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -376,7 +376,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW @@ -718,8 +718,6 @@ #define TR_CHECKLIST "Afficher notes" #define TR_FAS_OFFSET TR(INDENT "Corr FAS", INDENT "Correction FAS") #define TR_UART3MODE "Port série" -#define TR_POT1TYPE "Type S1" -#define TR_POT2TYPE "Type S2" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "RSSI Max" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index a014aca86..dea57bbe9 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -342,7 +342,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -376,7 +376,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW @@ -718,8 +718,6 @@ #define TR_CHECKLIST "Display Checklist" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") #define TR_UART3MODE "Serial port" -#define TR_POT1TYPE "S1 Type" -#define TR_POT2TYPE "S2 Type" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 1216179cc..e6a3608ba 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -342,7 +342,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -376,7 +376,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "GAZ""SK""SW""LOL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW @@ -718,8 +718,6 @@ #define TR_CHECKLIST "Display Checklist" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") #define TR_UART3MODE "Port szreg." -#define TR_POT1TYPE "Typ S1" -#define TR_POT2TYPE "Typ S2" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Maks RSSI" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index d8965ea56..aba6456dd 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -342,7 +342,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -376,7 +376,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW @@ -718,8 +718,6 @@ #define TR_CHECKLIST "Display Checklist" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") #define TR_UART3MODE "Serial port" -#define TR_POT1TYPE "S1 Type" -#define TR_POT2TYPE "S2 Type" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index a3efe2c4b..e559b277f 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -342,7 +342,7 @@ #define LEN_VSRCRAW "\004" #if defined(PCBTARANIS) - #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " + #define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""S3\0 ""LS\0 ""RS\0 " #define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 " #elif defined(EXTRA_3POS) #define TR_POTS_VSRCRAW "P1\0 ""P2\0 " @@ -376,7 +376,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26" + #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" #define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW @@ -718,8 +718,6 @@ #define TR_CHECKLIST "Display Checklist" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") #define TR_UART3MODE "Serieporten" -#define TR_POT1TYPE "S1-ratten" -#define TR_POT2TYPE "S2-ratten" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"