mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Merge pull request #770 from opentx/bsongis/Issue767_extra_pot
Bsongis/issue767 extra pot
This commit is contained in:
commit
8a0dc22578
35 changed files with 469 additions and 290 deletions
|
@ -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; i<C9X_MAX_EXPOS; i++)
|
||||
|
@ -913,7 +937,7 @@ void ModelData::clear()
|
|||
moduleData[0].ppmDelay = 300;
|
||||
moduleData[1].ppmDelay = 300;
|
||||
moduleData[2].ppmDelay = 300;
|
||||
int board=GetEepromInterface()->getBoard();
|
||||
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; i<NUM_STICKS; i++) {
|
||||
ExpoData * expo = &expoData[i];
|
||||
expo->chn = 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<NUM_STICKS; i++) {
|
||||
mixData[i].destCh = i+1;
|
||||
mixData[i].srcRaw = RawSource(SOURCE_TYPE_STICK, i);
|
||||
mixData[i].weight = 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ModelData::setDefaultValues(unsigned int id, GeneralSettings & settings)
|
||||
{
|
||||
clear();
|
||||
used = true;
|
||||
sprintf(name, "MODEL%02d", id+1);
|
||||
modelId = id+1;
|
||||
setDefaultMixes(settings);
|
||||
}
|
||||
|
||||
int ModelData::getTrimValue(int phaseIdx, int trimIdx)
|
||||
|
|
|
@ -107,10 +107,11 @@ const uint8_t modn12x3[4][4]= {
|
|||
#define DSW_SG2 20
|
||||
|
||||
const uint8_t chout_ar[] = { //First number is 0..23 -> 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,
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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<MAX_ROTARY_ENCODERS(board); i++)
|
||||
|
@ -733,12 +733,13 @@ void importGvarParam(int & gvar, const int _gvar)
|
|||
|
||||
class MixField: public TransformedField {
|
||||
public:
|
||||
MixField(MixData & mix, BoardEnum board, unsigned int version):
|
||||
MixField(MixData & mix, BoardEnum board, unsigned int version, ModelData * model):
|
||||
TransformedField(internalField),
|
||||
internalField("Mix"),
|
||||
mix(mix),
|
||||
board(board),
|
||||
version(version)
|
||||
version(version),
|
||||
model(model)
|
||||
{
|
||||
if (IS_TARANIS(board) && version >= 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,8 +1009,10 @@ class ExpoField: public TransformedField {
|
|||
virtual void afterImport()
|
||||
{
|
||||
if (IS_TARANIS(board) && version < 216) {
|
||||
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; j<maxCurves; j++) {
|
||||
CurveData *curve = &curves[j];
|
||||
curve->clear(5);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j=0; j<curve->count; 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; i<MAX_MIXERS(board, version); i++)
|
||||
internalField.Append(new MixField(modelData.mixData[i], board, version));
|
||||
internalField.Append(new MixField(modelData.mixData[i], board, version, &modelData));
|
||||
for (int i=0; i<MAX_CHANNELS(board, version); i++)
|
||||
internalField.Append(new LimitField(modelData.limitData[i], board, version));
|
||||
for (int i=0; i<MAX_EXPOS(board, version); i++)
|
||||
internalField.Append(new ExpoField(modelData.expoData[i], board, version));
|
||||
internalField.Append(new InputField(modelData.expoData[i], board, version));
|
||||
internalField.Append(new CurvesField(modelData.curves, board, version));
|
||||
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++)
|
||||
internalField.Append(new LogicalSwitchField(modelData.customSw[i], board, version, variant));
|
||||
internalField.Append(new LogicalSwitchField(modelData.customSw[i], board, version, variant, &modelData));
|
||||
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
|
||||
if (IS_ARM(board))
|
||||
internalField.Append(new ArmCustomFunctionField(modelData.funcSw[i], board, version, variant));
|
||||
|
@ -2346,7 +2372,7 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
|
|||
}
|
||||
}
|
||||
|
||||
void Open9xModelDataNew::beforeExport()
|
||||
void OpenTxModelData::beforeExport()
|
||||
{
|
||||
// qDebug() << QString("before export model") << modelData.name;
|
||||
|
||||
|
@ -2360,10 +2386,29 @@ void Open9xModelDataNew::beforeExport()
|
|||
}
|
||||
}
|
||||
|
||||
void Open9xModelDataNew::afterImport()
|
||||
void OpenTxModelData::afterImport()
|
||||
{
|
||||
// qDebug() << QString("after import model") << modelData.name ;
|
||||
|
||||
if (IS_TARANIS(board) && version < 216) {
|
||||
for (unsigned int i=0; i<NUM_STICKS; i++) {
|
||||
for (int j=0; j<64; j++) {
|
||||
ExpoData * expo = &modelData.expoData[j];
|
||||
if (expo->mode == 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<inputsCount; i++) {
|
||||
sum += generalData.calibMid[i];
|
||||
if (++count == inputsCount+5) break;
|
||||
if (++count == 12) break;
|
||||
sum += generalData.calibSpanNeg[i];
|
||||
if (++count == inputsCount+5) break;
|
||||
if (++count == 12) break;
|
||||
sum += generalData.calibSpanPos[i];
|
||||
if (++count == inputsCount+5) break;
|
||||
if (++count == 12) break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -2534,6 +2579,6 @@ void Open9xGeneralDataNew::beforeExport()
|
|||
chkSum = sum;
|
||||
}
|
||||
|
||||
void Open9xGeneralDataNew::afterImport()
|
||||
void OpenTxGeneralData::afterImport()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
#define O9X_ARM_MAX_CSFUNCOLD 13
|
||||
#define O9X_ARM_MAX_CSFUNC 15
|
||||
|
||||
class Open9xGeneralDataNew: public TransformedField {
|
||||
class OpenTxGeneralData: public TransformedField {
|
||||
public:
|
||||
Open9xGeneralDataNew(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant=0);
|
||||
OpenTxGeneralData(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant=0);
|
||||
|
||||
protected:
|
||||
virtual void beforeExport();
|
||||
|
@ -113,9 +113,9 @@ class ChannelsConversionTable: public ConversionTable
|
|||
};
|
||||
|
||||
|
||||
class Open9xModelDataNew: public TransformedField {
|
||||
class OpenTxModelData: public TransformedField {
|
||||
public:
|
||||
Open9xModelDataNew(ModelData & modelData, BoardEnum board, unsigned int version, unsigned int variant);
|
||||
OpenTxModelData(ModelData & modelData, BoardEnum board, unsigned int version, unsigned int variant);
|
||||
|
||||
const char * getName() { return name; }
|
||||
|
||||
|
@ -126,6 +126,7 @@ class Open9xModelDataNew: public TransformedField {
|
|||
StructField internalField;
|
||||
ModelData & modelData;
|
||||
BoardEnum board;
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
|
||||
private:
|
||||
|
|
|
@ -236,11 +236,11 @@ bool OpenTxInterface::loadModel(uint8_t version, ModelData &model, uint8_t *data
|
|||
return loadModel<Open9xArmModelData_v212>(model, data, index);
|
||||
}
|
||||
else {
|
||||
return loadModelVariant<Open9xModelDataNew>(index, model, data, version, variant);
|
||||
return loadModelVariant<OpenTxModelData>(index, model, data, version, variant);
|
||||
}
|
||||
}
|
||||
else if (version >= 213) {
|
||||
return loadModelVariant<Open9xModelDataNew>(index, model, data, version, variant);
|
||||
return loadModelVariant<OpenTxModelData>(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<Open9xGeneralDataNew>(radioData.generalSettings, version)) {
|
||||
if (!loadGeneral<OpenTxGeneralData>(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<Open9xGeneralDataNew>(radioData.generalSettings, board, version, variant);
|
||||
int result = saveGeneral<OpenTxGeneralData>(radioData.generalSettings, board, version, variant);
|
||||
if (!result) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
if (!radioData.models[i].isempty()) {
|
||||
result = saveModel<Open9xModelDataNew>(i, radioData.models[i], version, variant);
|
||||
result = saveModel<OpenTxModelData>(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:
|
||||
|
|
|
@ -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; i<NUM_PPM(GetEepromInterface()->getBoard()); i++) {
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(TrainerInputs); i++) {
|
||||
item = RawSource(SOURCE_TYPE_PPM, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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; i<C9X_MAX_EXPOS; i++) {
|
||||
for (int i=0; i<C9X_MAX_EXPOS; i++) {
|
||||
ExpoData *md = &model.expoData[i];
|
||||
|
||||
if (md->mode==0) break;
|
||||
|
@ -145,25 +145,23 @@ 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!"));
|
||||
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 */;
|
||||
|
||||
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)
|
||||
|
|
|
@ -6,24 +6,19 @@
|
|||
class MixersList : public QListWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MixersList(QWidget *parent, bool expo);
|
||||
// QMimeData * mimeData ( const QList<QListWidgetItem *> 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;
|
||||
|
||||
|
|
|
@ -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; i<GetEepromInterface()->getCapability(Mixes); i++) {
|
||||
for (i=0; i<GetEepromInterface()->getCapability(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(curDest<outputs+GetEepromInterface()->getCapability(ExtraChannels)) {
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include "helpers.h"
|
||||
|
||||
class DragDropHeader {
|
||||
public:
|
||||
public:
|
||||
DragDropHeader():
|
||||
general_settings(false),
|
||||
models_count(0)
|
||||
|
@ -58,11 +58,11 @@ public:
|
|||
ModelsListWidget::ModelsListWidget(QWidget *parent):
|
||||
QListWidget(parent)
|
||||
{
|
||||
this->setFont(QFont("Courier New",12));
|
||||
setFont(QFont("Courier New",12));
|
||||
radioData = &((MdiChild *)parent)->radioData;
|
||||
refreshList();
|
||||
|
||||
connect(this, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(OpenEditWindow()));
|
||||
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)));
|
||||
|
||||
|
@ -73,7 +73,7 @@ ModelsListWidget::ModelsListWidget(QWidget *parent):
|
|||
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)
|
||||
|
|
|
@ -381,7 +381,7 @@ void referenceModelAudioFiles()
|
|||
}
|
||||
|
||||
// Switches Audio Files <switchname>-[up|mid|down].wav
|
||||
for (int i=0; i<SWSRC_LAST_SWITCH+NUM_XPOTS*POTS_POS_COUNT && !found; i++) {
|
||||
for (int i=0; i<SWSRC_LAST_SWITCH+NUM_XPOTS*XPOTS_MULTIPOS_COUNT && !found; i++) {
|
||||
getSwitchAudioFile(path, i);
|
||||
if (!strcmp(filename, fn)) {
|
||||
sdAvailableSwitchAudioFiles |= MASK_SWITCH_AUDIO_FILE(i);
|
||||
|
|
|
@ -212,13 +212,72 @@ PACK(typedef struct {
|
|||
|
||||
}) ModelData_v215;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define NUM_POTS_215 4
|
||||
#else
|
||||
#define NUM_POTS_215 3
|
||||
#endif
|
||||
|
||||
PACK(typedef struct {
|
||||
uint8_t version;
|
||||
uint16_t variant;
|
||||
int16_t calibMid[NUM_STICKS+NUM_POTS];
|
||||
int16_t calibSpanNeg[NUM_STICKS+NUM_POTS];
|
||||
int16_t calibSpanPos[NUM_STICKS+NUM_POTS];
|
||||
int16_t calibMid[NUM_STICKS+NUM_POTS_215];
|
||||
int16_t calibSpanNeg[NUM_STICKS+NUM_POTS_215];
|
||||
int16_t calibSpanPos[NUM_STICKS+NUM_POTS_215];
|
||||
uint16_t chkSum;
|
||||
int8_t currModel;
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t backlightMode;
|
||||
TrainerData trainer;
|
||||
uint8_t view; // index of view in main screen
|
||||
int8_t buzzerMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||
uint8_t fai:1;
|
||||
int8_t beepMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||
uint8_t alarmsFlash:1;
|
||||
uint8_t disableMemoryWarning:1;
|
||||
uint8_t disableAlarmWarning:1;
|
||||
uint8_t stickMode:2;
|
||||
int8_t timezone:5;
|
||||
uint8_t spare1:1;
|
||||
uint8_t inactivityTimer;
|
||||
uint8_t mavbaud:3;
|
||||
SPLASH_MODE; /* 3bits */
|
||||
int8_t hapticMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||
uint8_t blOffBright:4;
|
||||
uint8_t blOnBright:4;
|
||||
uint8_t lightAutoOff;
|
||||
uint8_t templateSetup; // RETA order for receiver channels
|
||||
int8_t PPM_Multiplier;
|
||||
int8_t hapticLength;
|
||||
uint8_t reNavigation; // not used on STOCK board
|
||||
int8_t beepLength:3;
|
||||
uint8_t hapticStrength:3;
|
||||
uint8_t gpsFormat:1;
|
||||
uint8_t unexpectedShutdown:1;
|
||||
uint8_t speakerPitch;
|
||||
int8_t speakerVolume;
|
||||
int8_t vBatMin;
|
||||
int8_t vBatMax;
|
||||
uint8_t backlightBright;
|
||||
int8_t currentCalib;
|
||||
int8_t temperatureWarn;
|
||||
uint8_t mAhWarn;
|
||||
uint16_t mAhUsed;
|
||||
uint32_t globalTimer;
|
||||
int8_t temperatureCalib;
|
||||
uint8_t btBaudrate;
|
||||
uint8_t optrexDisplay;
|
||||
uint8_t sticksGain;
|
||||
uint8_t rotarySteps;
|
||||
uint8_t countryCode;
|
||||
uint8_t imperial;
|
||||
char ttsLanguage[2];
|
||||
int8_t beepVolume;
|
||||
int8_t wavVolume;
|
||||
int8_t varioVolume;
|
||||
int8_t backgroundVolume;
|
||||
}) GeneralSettings_v215;
|
||||
|
||||
void ConvertGeneralSettings_215_to_216(EEGeneral &settings)
|
||||
|
@ -227,12 +286,18 @@ void ConvertGeneralSettings_215_to_216(EEGeneral &settings)
|
|||
memcpy(&oldSettings, &settings, sizeof(oldSettings));
|
||||
|
||||
settings.version = 216;
|
||||
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
settings.calib[i].mid = oldSettings.calibMid[i];
|
||||
settings.calib[i].spanNeg = oldSettings.calibSpanNeg[i];
|
||||
settings.calib[i].spanPos = oldSettings.calibSpanPos[i];
|
||||
for (int i=0, j=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
settings.calib[i].mid = oldSettings.calibMid[j];
|
||||
settings.calib[i].spanNeg = oldSettings.calibSpanNeg[j];
|
||||
settings.calib[i].spanPos = oldSettings.calibSpanPos[j];
|
||||
#if defined(PCBTARANIS)
|
||||
if (i==POT3) continue;
|
||||
#endif
|
||||
j++;
|
||||
}
|
||||
settings.chkSum = evalChkSum();
|
||||
|
||||
memcpy(&settings.currModel, &oldSettings.currModel, sizeof(GeneralSettings_v215)-offsetof(GeneralSettings_v215, currModel));
|
||||
}
|
||||
|
||||
int ConvertTelemetrySource_215_to_216(int source)
|
||||
|
@ -270,6 +335,9 @@ int ConvertSource_215_to_216(int source, bool insertZero=false)
|
|||
// Virtual Inputs and Lua Outputs added
|
||||
if (source > 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)
|
||||
|
|
|
@ -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);
|
||||
uint8_t potType = selectMenuItem(HW_SETTINGS_COLUMN, y, i==ITEM_SETUP_HW_POT1 ? STR_POT1TYPE : STR_POT2TYPE, STR_POTTYPES, (g_eeGeneral.potsType & mask) >> idx, 0, 1, attr, event);
|
||||
if (potType)
|
||||
g_eeGeneral.potsType |= mask;
|
||||
else
|
||||
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; j<count; j++) {
|
||||
for (int k=j+1; k<count; k++) {
|
||||
if (reusableBuffer.calib.xpotsCalib[idx].steps[k] < reusableBuffer.calib.xpotsCalib[idx].steps[j]) {
|
||||
|
@ -1451,11 +1457,11 @@ void menuCommonCalib(uint8_t event)
|
|||
if (reusableBuffer.calib.state == 2) {
|
||||
steps = reusableBuffer.calib.xpotsCalib[i-POT1].stepsCount;
|
||||
}
|
||||
else if (IS_MULTIPOS_POT(i)) {
|
||||
else if (IS_POT_MULTIPOS(i)) {
|
||||
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[i];
|
||||
steps = calib->count + 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<<index)) {
|
||||
if (swtch >= 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;
|
||||
|
|
|
@ -122,9 +122,11 @@ void drawPotsBars()
|
|||
// Optimization by Mike Blandford
|
||||
uint8_t x, i, len ; // declare temporary variables
|
||||
for (x=LCD_W/2-5, i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; x+=5, i++) {
|
||||
if (IS_POT_AVAILABLE(i)) {
|
||||
len = ((calibratedStick[i]+RESX)*BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
|
||||
V_BAR(x, LCD_H-8, len)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void drawStick(uint8_t centrex, int16_t xval, int16_t yval)
|
||||
|
@ -196,8 +198,11 @@ void displayTrims(uint8_t phase)
|
|||
void displaySliders()
|
||||
{
|
||||
for (uint8_t i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
xcoord_t x = (i%2 ? LCD_W-5 : 3);
|
||||
int8_t y = (i>NUM_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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -78,6 +78,8 @@
|
|||
#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
|
||||
|
@ -87,6 +89,8 @@
|
|||
#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
|
||||
|
@ -96,6 +100,8 @@
|
|||
#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
|
||||
|
@ -105,6 +111,8 @@
|
|||
#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
|
||||
|
@ -114,6 +122,8 @@
|
|||
#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,
|
||||
|
|
|
@ -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; i<NUM_STICKS+NUM_POTS+5; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
sum += calibValues[i];
|
||||
return sum;
|
||||
}
|
||||
|
@ -1404,7 +1404,7 @@ void getSwitchesPosition(bool startup)
|
|||
for (int i=0; i<NUM_XPOTS; i++) {
|
||||
if (g_eeGeneral.potsType & (1 << i)) {
|
||||
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[POT1+i];
|
||||
if (calib->count>0 && calib->count<POTS_POS_COUNT) {
|
||||
if (calib->count>0 && calib->count<XPOTS_MULTIPOS_COUNT) {
|
||||
uint8_t pos = anaIn(POT1+i) / (2*RESX/calib->count);
|
||||
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->count<POTS_POS_COUNT) {
|
||||
if (!s_noScroll && IS_POT_MULTIPOS(x) && calib->count>0 && calib->count<XPOTS_MULTIPOS_COUNT) {
|
||||
uint8_t vShifted = (v >> 4);
|
||||
s_anaFilt[x] = 2*RESX;
|
||||
for (int i=0; i<calib->count; 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 {
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -407,18 +407,18 @@ uint16_t anaIn(uint8_t chan)
|
|||
else if (chan<NUM_STICKS+NUM_POTS)
|
||||
return th9xSim->knobs[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
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue