Global functions (only Firmware) - saves 20bytes flash on 9X stock

This commit is contained in:
bsongis
2014-09-18 11:44:09 +02:00
parent 5173907efd
commit 2f8b9347a4
55 changed files with 1328 additions and 1154 deletions
+3 -3
View File
@@ -378,9 +378,9 @@ t_Er9xModelData::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
c9x.customFn[0].func = FuncInstantTrim;
if (trimSw) {
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
@@ -459,7 +459,7 @@ t_Er9xModelData::operator ModelData ()
}
for (int i=0; i<ER9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<ER9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
+1 -1
View File
@@ -241,7 +241,7 @@ PACK(typedef struct t_Er9xModelData {
int8_t trim[4];
int8_t curves5[ER9X_MAX_CURVE5][5];
int8_t curves9[ER9X_MAX_CURVE9][9];
Er9xLogicalSwitchData customSw[ER9X_NUM_CSW];
Er9xLogicalSwitchData logicalSw[ER9X_NUM_CSW];
uint8_t frSkyVoltThreshold ;
int8_t tmrModeB;
uint8_t numVoice;
@@ -75,12 +75,12 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
for (int i=0; i<ER9X_MAX_MIXERS; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ER9X_NUM_CSW; i++) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
break;
default:
break;
@@ -510,9 +510,9 @@ t_Ersky9xModelData_v10::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
c9x.customFn[0].func = FuncInstantTrim;
if (trimSw) {
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
@@ -587,7 +587,7 @@ t_Ersky9xModelData_v10::operator ModelData ()
}
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V10; i++)
// c9x.safetySw[i] = safetySw[i];
@@ -626,9 +626,9 @@ t_Ersky9xModelData_v11::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
c9x.customFn[0].func = FuncInstantTrim;
if (trimSw) {
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
@@ -703,7 +703,7 @@ t_Ersky9xModelData_v11::operator ModelData ()
}
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V11; i++)
// c9x.safetySw[i] = safetySw[i];
@@ -246,13 +246,13 @@ PACK(typedef struct t_Ersky9xFlightModeData {
uint16_t spare ; // Future expansion
}) Ersky9xFlightModeData;
PACK(typedef struct t_Ersky9xFuncSwData { // Function Switches data
PACK(typedef struct t_Ersky9xCustomFunctionData { // Function Switches data
int8_t swtch; //input
uint8_t func;
char param[6];
uint8_t delay;
uint8_t spare;
}) Ersky9xFuncSwData;
}) Ersky9xCustomFunctionData;
PACK(typedef struct t_Ersky9xFrSkyChannelData_v10 {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
@@ -360,7 +360,7 @@ PACK(typedef struct t_Ersky9xModelData_v10 {
int8_t trim[4];
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
Ersky9xLogicalSwitchData_v10 customSw[ERSKY9X_NUM_CSW_V10];
Ersky9xLogicalSwitchData_v10 logicalSw[ERSKY9X_NUM_CSW_V10];
uint8_t frSkyVoltThreshold ;
uint8_t res3[2];
Ersky9xSafetySwData_v10 safetySw[ERSKY9X_NUM_CHNOUT_V10];
@@ -409,7 +409,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
int8_t curvexy[18];
Ersky9xLogicalSwitchData_v11 customSw[ERSKY9X_NUM_CSW_V11];
Ersky9xLogicalSwitchData_v11 logicalSw[ERSKY9X_NUM_CSW_V11];
uint8_t frSkyVoltThreshold ;
uint8_t bt_telemetry;
uint8_t numVoice; // 0-16, rest are Safety switches
@@ -420,7 +420,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
Ersky9xFrSkyAlarmData_v11 frskyAlarms ;
// Add 6 bytes for custom telemetry screen
uint8_t customDisplayIndex[6] ;
Ersky9xFuncSwData funcSw[ERSKY9X_NUM_FSW];
Ersky9xCustomFunctionData customFn[ERSKY9X_NUM_FSW];
Ersky9xFlightModeData flightModeData[6] ;
Ersky9xGvarData gvars[ERSKY9X_MAX_GVARS] ;
@@ -74,12 +74,12 @@ inline void applyStickModeToModel(Ersky9xModelData_v10 & model, unsigned int mod
for (int i=0; i<ERSKY9X_MAX_MIXERS_V10; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
break;
default:
break;
@@ -106,12 +106,12 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
for (int i=0; i<ERSKY9X_MAX_MIXERS_V11; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
break;
default:
break;
@@ -322,9 +322,9 @@ Gruvin9xLogicalSwitchData::operator LogicalSwitchData ()
return c9x;
}
Gruvin9xFuncSwData::operator FuncSwData ()
Gruvin9xCustomFunctionData::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = gruvin9xToSwitch(swtch);
c9x.func = (AssignFunc)(func + G9X_NUM_CHNOUT);
return c9x;
@@ -476,7 +476,7 @@ t_Gruvin9xModelData_v102::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -546,7 +546,7 @@ t_Gruvin9xModelData_v103::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -633,9 +633,9 @@ t_Gruvin9xModelData_v105::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -716,9 +716,9 @@ t_Gruvin9xModelData_v106::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -202,13 +202,13 @@ PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
t_Gruvin9xSafetySwData() { memset(this, 0, sizeof(t_Gruvin9xSafetySwData)); }
}) Gruvin9xSafetySwData;
PACK(typedef struct t_Gruvin9xFuncSwData { // Function Switches data
PACK(typedef struct t_Gruvin9xCustomFunctionData { // Function Switches data
int8_t swtch; // input
uint8_t func;
operator FuncSwData();
t_Gruvin9xFuncSwData() { memset(this, 0, sizeof(t_Gruvin9xFuncSwData)); }
}) Gruvin9xFuncSwData;
operator CustomFunctionData();
t_Gruvin9xCustomFunctionData() { memset(this, 0, sizeof(t_Gruvin9xCustomFunctionData)); }
}) Gruvin9xCustomFunctionData;
PACK(typedef struct t_Gruvin9xFrSkyChannelData {
uint16_t ratio:12; // (Maximum resistor divider input volts +/- calibration. 0 means channel not used.
@@ -309,7 +309,7 @@ PACK(typedef struct t_Gruvin9xModelData_v102 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
@@ -341,7 +341,7 @@ PACK(typedef struct t_Gruvin9xModelData_v103 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
@@ -373,9 +373,9 @@ PACK(typedef struct t_Gruvin9xModelData_v105 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
int16_t subtrim[NUM_STICKS];
@@ -405,9 +405,9 @@ PACK(typedef struct t_Gruvin9xModelData_v106 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v106 flightModeData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
@@ -339,9 +339,9 @@ Open9xGruvin9xLogicalSwitchData_v209::operator LogicalSwitchData ()
return c9x;
}
t_Open9xGruvin9xFuncSwData_v203::operator FuncSwData ()
t_Open9xGruvin9xCustomFunctionData_v203::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
if (func < 16) {
c9x.func = (AssignFunc)(func);
@@ -378,9 +378,9 @@ t_Open9xGruvin9xFuncSwData_v203::operator FuncSwData ()
return c9x;
}
t_Open9xGruvin9xFuncSwData_v210::operator FuncSwData ()
t_Open9xGruvin9xCustomFunctionData_v210::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
c9x.param = param;
if (func < 22) {
@@ -494,9 +494,9 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
@@ -577,9 +577,9 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
}
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -666,9 +666,9 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
}
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -759,9 +759,9 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
}
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -846,9 +846,9 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
}
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -132,24 +132,24 @@ PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v209 { // Custom Switches
RawSource toSource(int8_t value);
}) Open9xGruvin9xLogicalSwitchData_v209;
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
PACK(typedef struct t_Open9xGruvin9xCustomFunctionData_v203 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator FuncSwData();
t_Open9xGruvin9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v203)); }
}) Open9xGruvin9xFuncSwData_v203;
operator CustomFunctionData();
t_Open9xGruvin9xCustomFunctionData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomFunctionData_v203)); }
}) Open9xGruvin9xCustomFunctionData_v203;
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v210 { // Function Switches data
PACK(typedef struct t_Open9xGruvin9xCustomFunctionData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func:5;
uint8_t delay:3;
uint8_t param;
operator FuncSwData();
t_Open9xGruvin9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v210)); }
}) Open9xGruvin9xFuncSwData_v210;
operator CustomFunctionData();
t_Open9xGruvin9xCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomFunctionData_v210)); }
}) Open9xGruvin9xCustomFunctionData_v210;
PACK(typedef struct t_Open9xGruvin9xSwashRingData_v208 { // Swash Ring data
uint8_t invertELE:1;
@@ -194,8 +194,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xGruvin9xLogicalSwitchData_v207 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v207 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xFlightModeData_v207 flightModeData[5];
Open9xFrSkyData_v205 frsky;
@@ -228,8 +228,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xGruvin9xLogicalSwitchData_v207 customSw[12];
Open9xGruvin9xFuncSwData_v203 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v207 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v203 customFn[16];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
Open9xFrSkyData_v208 frsky;
@@ -267,8 +267,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xGruvin9xLogicalSwitchData_v209 customSw[12];
Open9xGruvin9xFuncSwData_v203 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v203 customFn[16];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
Open9xFrSkyData_v208 frsky;
@@ -307,8 +307,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
Open9xExpoData_v201 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xGruvin9xLogicalSwitchData_v209 customSw[12];
Open9xGruvin9xFuncSwData_v210 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v210 customFn[16];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
@@ -345,8 +345,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
Open9xExpoData_v211 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xGruvin9xLogicalSwitchData_v209 customSw[12];
Open9xGruvin9xFuncSwData_v210 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v210 customFn[16];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
@@ -571,9 +571,9 @@ t_Open9xArmLogicalSwitchData_v210::operator LogicalSwitchData ()
return c9x;
}
t_Open9xArmFuncSwData_v208::operator FuncSwData ()
t_Open9xArmCustomFunctionData_v208::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
if (c9x.func <= FuncOverrideCH32) {
@@ -589,9 +589,9 @@ t_Open9xArmFuncSwData_v208::operator FuncSwData ()
return c9x;
}
t_Open9xArmFuncSwData_v210::operator FuncSwData ()
t_Open9xArmCustomFunctionData_v210::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
uint32_t value = *((uint32_t *)param);
@@ -613,9 +613,9 @@ t_Open9xArmFuncSwData_v210::operator FuncSwData ()
return c9x;
}
t_Open9xArmFuncSwData_v211::operator FuncSwData ()
t_Open9xArmCustomFunctionData_v211::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
uint32_t value = *((uint32_t *)param);
@@ -798,9 +798,9 @@ t_Open9xArmModelData_v208::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -887,9 +887,9 @@ t_Open9xArmModelData_v209::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -977,9 +977,9 @@ t_Open9xArmModelData_v210::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -1064,9 +1064,9 @@ t_Open9xArmModelData_v211::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -1151,9 +1151,9 @@ t_Open9xArmModelData_v212::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -208,34 +208,34 @@ PACK(typedef struct t_Open9xArmLogicalSwitchData_v210 { // Custom Switches data
t_Open9xArmLogicalSwitchData_v210() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v210)); }
}) Open9xArmLogicalSwitchData_v210;
PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
PACK(typedef struct t_Open9xArmCustomFunctionData_v208 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator FuncSwData();
t_Open9xArmFuncSwData_v208() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v208)); }
}) Open9xArmFuncSwData_v208;
operator CustomFunctionData();
t_Open9xArmCustomFunctionData_v208() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v208)); }
}) Open9xArmCustomFunctionData_v208;
PACK(typedef struct t_Open9xArmFuncSwData_v210 { // Function Switches data
PACK(typedef struct t_Open9xArmCustomFunctionData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func;
char param[6];
operator FuncSwData();
t_Open9xArmFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v210)); }
}) Open9xArmFuncSwData_v210;
operator CustomFunctionData();
t_Open9xArmCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v210)); }
}) Open9xArmCustomFunctionData_v210;
PACK(typedef struct t_Open9xArmFuncSwData_v211 { // Function Switches data
PACK(typedef struct t_Open9xArmCustomFunctionData_v211 { // Function Switches data
int8_t swtch; // input
uint8_t func;
char param[6];
uint8_t delay;
uint8_t spare;
operator FuncSwData();
t_Open9xArmFuncSwData_v211() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v211)); }
}) Open9xArmFuncSwData_v211;
operator CustomFunctionData();
t_Open9xArmCustomFunctionData_v211() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v211)); }
}) Open9xArmCustomFunctionData_v211;
PACK(typedef struct t_Open9xArmSwashRingData_v208 { // Swash Ring data
uint8_t invertELE:1;
@@ -332,8 +332,8 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
Open9xArmExpoData_v208 expoData[32];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xArmLogicalSwitchData_v208 customSw[32];
Open9xArmFuncSwData_v208 funcSw[32];
Open9xArmLogicalSwitchData_v208 logicalSw[32];
Open9xArmCustomFunctionData_v208 customFn[32];
Open9xArmSwashRingData_v208 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xFrSkyData_v208 frsky;
@@ -371,8 +371,8 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
Open9xArmExpoData_v208 expoData[32];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xArmLogicalSwitchData_v209 customSw[32];
Open9xArmFuncSwData_v208 funcSw[32];
Open9xArmLogicalSwitchData_v209 logicalSw[32];
Open9xArmCustomFunctionData_v208 customFn[32];
Open9xArmSwashRingData_v209 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xFrSkyData_v208 frsky;
@@ -411,8 +411,8 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
Open9xArmExpoData_v210 expoData[32];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xArmLogicalSwitchData_v210 customSw[32];
Open9xArmFuncSwData_v210 funcSw[32];
Open9xArmLogicalSwitchData_v210 logicalSw[32];
Open9xArmCustomFunctionData_v210 customFn[32];
Open9xArmSwashRingData_v209 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xArmFrSkyData_v210 frsky;
@@ -450,8 +450,8 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
Open9xArmExpoData_v210 expoData[32];
int16_t curves[16];
int8_t points[512];
Open9xArmLogicalSwitchData_v210 customSw[32];
Open9xArmFuncSwData_v211 funcSw[32];
Open9xArmLogicalSwitchData_v210 logicalSw[32];
Open9xArmCustomFunctionData_v211 customFn[32];
Open9xArmSwashRingData_v209 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
@@ -488,8 +488,8 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
Open9xArmExpoData_v212 expoData[32];
int16_t curves[16];
int8_t points[512];
Open9xArmLogicalSwitchData_v210 customSw[32];
Open9xArmFuncSwData_v211 funcSw[32];
Open9xArmLogicalSwitchData_v210 logicalSw[32];
Open9xArmCustomFunctionData_v211 customFn[32];
Open9xArmSwashRingData_v210 swashR;
Open9xArmFlightModeData_v212 flightModeData[9];
@@ -564,9 +564,9 @@ Open9xLogicalSwitchData_v209::operator LogicalSwitchData ()
return c9x;
}
t_Open9xFuncSwData_v201::operator FuncSwData ()
t_Open9xCustomFunctionData_v201::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
c9x.func = (AssignFunc)(func+16);
return c9x;
@@ -598,9 +598,9 @@ enum Functions {
FUNC_MAX
};
t_Open9xFuncSwData_v203::operator FuncSwData ()
t_Open9xCustomFunctionData_v203::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
if (func < 16) {
c9x.enabled=param & 0x01;
@@ -628,9 +628,9 @@ t_Open9xFuncSwData_v203::operator FuncSwData ()
return c9x;
}
t_Open9xFuncSwData_v210::operator FuncSwData ()
t_Open9xCustomFunctionData_v210::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
c9x.param = param;
if (func < 22) {
@@ -977,9 +977,9 @@ t_Open9xModelData_v201::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<12; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
// for (int i=0; i<16; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -1051,9 +1051,9 @@ t_Open9xModelData_v202::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<12; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
// for (int i=0; i<16; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -1127,9 +1127,9 @@ t_Open9xModelData_v203::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
@@ -1201,9 +1201,9 @@ t_Open9xModelData_v204::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.rssiAlarms[0] = frskyRssiAlarms[0].get(0);
@@ -1280,9 +1280,9 @@ t_Open9xModelData_v205::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
@@ -1366,9 +1366,9 @@ t_Open9xModelData_v208::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -1459,9 +1459,9 @@ t_Open9xModelData_v209::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -1556,9 +1556,9 @@ t_Open9xModelData_v210::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -1644,9 +1644,9 @@ t_Open9xModelData_v211::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -247,32 +247,32 @@ PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
t_Open9xSafetySwData() { memset(this, 0, sizeof(t_Open9xSafetySwData)); }
}) Open9xSafetySwData;
PACK(typedef struct t_Open9xFuncSwData_v201 { // Function Switches data
PACK(typedef struct t_Open9xCustomFunctionData_v201 { // Function Switches data
int8_t swtch; // input
uint8_t func;
operator FuncSwData();
t_Open9xFuncSwData_v201() { memset(this, 0, sizeof(t_Open9xFuncSwData_v201)); }
}) Open9xFuncSwData_v201;
operator CustomFunctionData();
t_Open9xCustomFunctionData_v201() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v201)); }
}) Open9xCustomFunctionData_v201;
PACK(typedef struct t_Open9xFuncSwData_v203 { // Function Switches data
PACK(typedef struct t_Open9xCustomFunctionData_v203 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator FuncSwData();
t_Open9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xFuncSwData_v203)); }
}) Open9xFuncSwData_v203;
operator CustomFunctionData();
t_Open9xCustomFunctionData_v203() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v203)); }
}) Open9xCustomFunctionData_v203;
PACK(typedef struct t_Open9xFuncSwData_v210 { // Function Switches data
PACK(typedef struct t_Open9xCustomFunctionData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func:5;
uint8_t delay:3;
uint8_t param;
operator FuncSwData();
t_Open9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xFuncSwData_v210)); }
}) Open9xFuncSwData_v210;
operator CustomFunctionData();
t_Open9xCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v210)); }
}) Open9xCustomFunctionData_v210;
PACK(typedef struct t_Open9xFrSkyChannelData_v201 {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
@@ -502,9 +502,9 @@ PACK(typedef struct t_Open9xModelData_v201 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xSafetySwData safetySw[16];
Open9xFuncSwData_v201 funcSw[12];
Open9xCustomFunctionData_v201 customFn[12];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v201 frsky;
@@ -533,9 +533,9 @@ PACK(typedef struct t_Open9xModelData_v202 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xSafetySwData safetySw[16];
Open9xFuncSwData_v201 funcSw[12];
Open9xCustomFunctionData_v201 customFn[12];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v202 frsky;
@@ -567,8 +567,8 @@ PACK(typedef struct t_Open9xModelData_v203 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v202 frsky;
@@ -600,8 +600,8 @@ PACK(typedef struct t_Open9xModelData_v204 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v204 frsky;
@@ -633,8 +633,8 @@ PACK(typedef struct t_Open9xModelData_v205 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v205 frsky;
@@ -668,8 +668,8 @@ PACK(typedef struct t_Open9xModelData_v208 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v208 frsky;
@@ -707,8 +707,8 @@ PACK(typedef struct t_Open9xModelData_v209 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v209 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v209 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v209 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v208 frsky;
@@ -747,8 +747,8 @@ PACK(typedef struct t_Open9xModelData_v210 {
Open9xExpoData_v201 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xLogicalSwitchData_v209 customSw[12];
Open9xFuncSwData_v210 funcSw[16];
Open9xLogicalSwitchData_v209 logicalSw[12];
Open9xCustomFunctionData_v210 customFn[16];
Open9xSwashRingData_v209 swashR;
Open9xFlightModeData_v201 flightModeData[5];
@@ -785,8 +785,8 @@ PACK(typedef struct t_Open9xModelData_v211 {
Open9xExpoData_v211 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xLogicalSwitchData_v209 customSw[12];
Open9xFuncSwData_v210 funcSw[16];
Open9xLogicalSwitchData_v209 logicalSw[12];
Open9xCustomFunctionData_v210 customFn[16];
Open9xSwashRingData_v209 swashR;
Open9xFlightModeData_v201 flightModeData[5];
@@ -65,6 +65,7 @@ namespace Open9xGruvin9x {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
@@ -66,6 +66,7 @@ namespace OpenTxM128 {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
@@ -71,6 +71,7 @@ namespace OpenTxM64 {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
@@ -78,6 +78,7 @@ namespace Open9xSky9x {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/targets/sky9x/pulses_driver.cpp"
@@ -81,6 +81,7 @@ inline int geteepromsize() {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/targets/taranis/pulses_driver.cpp"
@@ -1879,7 +1879,7 @@ class SwitchesWarningField: public TransformedField {
class ArmCustomFunctionField: public TransformedField {
public:
ArmCustomFunctionField(FuncSwData & fn, BoardEnum board, unsigned int version, unsigned int variant):
ArmCustomFunctionField(CustomFunctionData & fn, BoardEnum board, unsigned int version, unsigned int variant):
TransformedField(internalField),
internalField("CustomFunction"),
fn(fn),
@@ -2073,7 +2073,7 @@ class ArmCustomFunctionField: public TransformedField {
protected:
StructField internalField;
FuncSwData & fn;
CustomFunctionData & fn;
BoardEnum board;
unsigned int version;
unsigned int variant;
@@ -2086,7 +2086,7 @@ class ArmCustomFunctionField: public TransformedField {
class AvrCustomFunctionField: public TransformedField {
public:
AvrCustomFunctionField(FuncSwData & fn, BoardEnum board, unsigned int version, unsigned int variant):
AvrCustomFunctionField(CustomFunctionData & fn, BoardEnum board, unsigned int version, unsigned int variant):
TransformedField(internalField),
internalField("CustomFunction"),
fn(fn),
@@ -2237,7 +2237,7 @@ class AvrCustomFunctionField: public TransformedField {
protected:
StructField internalField;
FuncSwData & fn;
CustomFunctionData & fn;
BoardEnum board;
unsigned int version;
unsigned int variant;
@@ -2645,12 +2645,12 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
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, &modelData));
internalField.Append(new LogicalSwitchField(modelData.logicalSw[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));
internalField.Append(new ArmCustomFunctionField(modelData.customFn[i], board, version, variant));
else
internalField.Append(new AvrCustomFunctionField(modelData.funcSw[i], board, version, variant));
internalField.Append(new AvrCustomFunctionField(modelData.customFn[i], board, version, variant));
}
internalField.Append(new HeliField(modelData.swashRingData, board, version, variant));
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++)
+2 -2
View File
@@ -274,9 +274,9 @@ t_Th9xModelData::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncTrims2Offsets;
c9x.customFn[0].func = FuncTrims2Offsets;
if (trimSw) {
c9x.funcSw[0].swtch = trimSw;
c9x.customFn[0].swtch = trimSw;
}
c9x.beepANACenter = beepANACenter;
c9x.pulsePol = pulsePol;