Merge branch 'next' of https://github.com/opentx/opentx into bsongis/Side_back_in_expos_is_it_useful
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
#define PCBTARANIS
|
||||
#define CPUARM
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define FRSKY
|
||||
@@ -103,7 +102,6 @@ inline int geteepromsize() {
|
||||
#undef SDCARD
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#define SDCARD
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
||||
|
||||
@@ -294,6 +294,32 @@ class SourcesConversionTable: public ConversionTable {
|
||||
}
|
||||
};
|
||||
|
||||
ThrottleSourceConversionTable::ThrottleSourceConversionTable(BoardEnum board, unsigned int version)
|
||||
{
|
||||
int val=0;
|
||||
|
||||
addConversion(THROTTLE_SOURCE_THR, val++);
|
||||
|
||||
if (IS_TARANIS(board)) {
|
||||
addConversion(THROTTLE_SOURCE_S1, val++);
|
||||
addConversion(THROTTLE_SOURCE_S2, val++);
|
||||
if (version >= 216)
|
||||
addConversion(THROTTLE_SOURCE_S3, val++);
|
||||
addConversion(THROTTLE_SOURCE_LS, val++);
|
||||
addConversion(THROTTLE_SOURCE_RS, val++);
|
||||
}
|
||||
else {
|
||||
addConversion(THROTTLE_SOURCE_P1, val++);
|
||||
addConversion(THROTTLE_SOURCE_P2, val++);
|
||||
addConversion(THROTTLE_SOURCE_P3, val++);
|
||||
}
|
||||
|
||||
for (int i=0; i<MAX_CHANNELS(board, version); i++) {
|
||||
addConversion(THROTTLE_SOURCE_FIRST_CHANNEL+i, val++);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <int N>
|
||||
class SwitchField: public ConversionField< SignedField<N> > {
|
||||
public:
|
||||
@@ -2175,7 +2201,8 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
board(board),
|
||||
version(version),
|
||||
variant(variant),
|
||||
protocolsConversionTable(board)
|
||||
protocolsConversionTable(board),
|
||||
throttleSourceConversionTable(board, version)
|
||||
{
|
||||
sprintf(name, "Model %s", modelData.name);
|
||||
|
||||
@@ -2285,7 +2312,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppmFrameLength));
|
||||
}
|
||||
|
||||
internalField.Append(new UnsignedField<8>(modelData.thrTraceSrc));
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(modelData.thrTraceSrc, &throttleSourceConversionTable, "Throttle Source"));
|
||||
|
||||
if (!afterrelease21March2013) {
|
||||
internalField.Append(new UnsignedField<8>(modelData.modelId));
|
||||
@@ -2565,8 +2592,8 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
}
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.hw_uartMode));
|
||||
for (int i=0; i<8; i++) {
|
||||
internalField.Append(new UnsignedField<1>(generalData.potsType[i]));
|
||||
for (int i=0; i<4; i++) {
|
||||
internalField.Append(new UnsignedField<2>(potsType[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2585,6 +2612,11 @@ void OpenTxGeneralData::beforeExport()
|
||||
sum += generalData.calibSpanPos[i];
|
||||
if (++count == 12) break;
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
potsType[i] = generalData.potsType[i];
|
||||
if (i<2 && potsType[i] == 1)
|
||||
potsType[i] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<inputsCount; i++)
|
||||
@@ -2597,4 +2629,8 @@ void OpenTxGeneralData::beforeExport()
|
||||
|
||||
void OpenTxGeneralData::afterImport()
|
||||
{
|
||||
for (int i=0; i<4; i++) {
|
||||
if (i<2 && generalData.potsType[i] == 0)
|
||||
generalData.potsType[i] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ class OpenTxGeneralData: public TransformedField {
|
||||
unsigned int version;
|
||||
int inputsCount;
|
||||
unsigned int chkSum;
|
||||
unsigned int potsType[4];
|
||||
};
|
||||
|
||||
class ProtocolsConversionTable: public ConversionTable
|
||||
@@ -102,6 +103,12 @@ class ProtocolsConversionTable: public ConversionTable
|
||||
}
|
||||
};
|
||||
|
||||
class ThrottleSourceConversionTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
ThrottleSourceConversionTable(BoardEnum board, unsigned int version);
|
||||
};
|
||||
|
||||
class ChannelsConversionTable: public ConversionTable
|
||||
{
|
||||
public:
|
||||
@@ -133,6 +140,7 @@ class OpenTxModelData: public TransformedField {
|
||||
char name[256];
|
||||
int subprotocols[C9X_NUM_MODULES+1/*trainer*/];
|
||||
ProtocolsConversionTable protocolsConversionTable;
|
||||
ThrottleSourceConversionTable throttleSourceConversionTable;
|
||||
ChannelsConversionTable channelsConversionTable;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user