Fixes #1228
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "0" )
|
||||
SET( C9X_VERSION_REVISION "9" )
|
||||
SET( C9X_VERSION_MINOR "1" )
|
||||
SET( C9X_VERSION_REVISION "0" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
|
||||
@@ -1162,7 +1162,7 @@ void ModelData::clear()
|
||||
funcSw[i].clear();
|
||||
for (int i=0; i<C9X_MAX_CURVES; i++)
|
||||
curves[i].clear(5);
|
||||
for (int i=0; i<2; i++)
|
||||
for (int i=0; i<C9X_MAX_TIMERS; i++)
|
||||
timers[i].clear();
|
||||
swashRingData.clear();
|
||||
frsky.clear();
|
||||
|
||||
@@ -70,6 +70,7 @@ const uint8_t modn12x3[4][4]= {
|
||||
{4, 3, 2, 1} };
|
||||
|
||||
#define C9X_MAX_MODELS 60
|
||||
#define C9X_MAX_TIMERS 3
|
||||
#define C9X_MAX_FLIGHT_MODES 9
|
||||
#define C9X_MAX_MIXERS 64
|
||||
#define C9X_MAX_INPUTS 32
|
||||
@@ -199,7 +200,6 @@ enum HeliSwashTypes {
|
||||
#define NUM_CYC 3
|
||||
#define C9X_NUM_SWITCHES 10
|
||||
#define C9X_NUM_KEYS 6
|
||||
#define C9X_MAX_TIMERS 2
|
||||
|
||||
extern const char * switches9X[];
|
||||
extern const char * switchesX9D[];
|
||||
@@ -983,7 +983,7 @@ class ModelData {
|
||||
|
||||
bool used;
|
||||
char name[12+1];
|
||||
TimerData timers[2];
|
||||
TimerData timers[C9X_MAX_TIMERS];
|
||||
bool thrTrim; // Enable Throttle Trim
|
||||
int trimInc; // Trim Increments
|
||||
bool disableThrottleWarning;
|
||||
@@ -1055,7 +1055,6 @@ class RadioData {
|
||||
ModelData models[C9X_MAX_MODELS];
|
||||
};
|
||||
|
||||
// TODO rename FlightPhase to FlightMode
|
||||
enum Capability {
|
||||
FlightModes,
|
||||
FlightModesName,
|
||||
|
||||
@@ -436,7 +436,7 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -460,7 +460,7 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -471,31 +471,31 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -517,7 +517,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -545,7 +545,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -556,29 +556,29 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -594,7 +594,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -606,7 +606,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -634,7 +634,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -645,29 +645,29 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -684,7 +684,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -724,7 +724,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -735,13 +735,13 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -758,9 +758,9 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -768,7 +768,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -780,7 +780,7 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++) {
|
||||
for (int i=0; i<2; i++) {
|
||||
c9x.timers[i] = timers[i];
|
||||
c9x.timers[i].persistent = timersXtra[i].remanent;
|
||||
c9x.timers[i].val = timersXtra[i].value;
|
||||
@@ -811,7 +811,7 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -822,13 +822,13 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -845,9 +845,9 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
|
||||
@@ -177,7 +177,7 @@ PACK(typedef struct t_Open9xGruvin9xSwashRingData_v209 { // Swash Ring data
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -189,15 +189,15 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v207 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[12];
|
||||
Open9xFuncSwData_v203 funcSw[16];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xFlightModeData_v207 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v207 flightModeData[5];
|
||||
Open9xFrSkyData_v205 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -211,7 +211,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -223,22 +223,22 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v207 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[12];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[16];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -250,7 +250,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -262,22 +262,22 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v209 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[12];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[16];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -290,7 +290,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -302,21 +302,21 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v209 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves[8];
|
||||
int8_t points[112-8];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[12];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[16];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
@@ -328,7 +328,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -340,15 +340,15 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v211 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xMixData_v211 mixData[32];
|
||||
Open9xLimitData_v211 limitData[16];
|
||||
Open9xExpoData_v211 expoData[14];
|
||||
int8_t curves[8];
|
||||
int8_t points[112-8];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[12];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[16];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -356,7 +356,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xFrSkyData_v210 frsky;
|
||||
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
|
||||
Open9xTimerDataExtra timersXtra[2];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xGruvin9xModelData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v211)); }
|
||||
|
||||
@@ -261,17 +261,17 @@ t_Open9xArmMixData_v208::operator MixData ()
|
||||
else if (srcRaw == 9) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 9+9+O9X_ARM_NUM_CSW) {
|
||||
else if (srcRaw <= 9+9+32) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-9);
|
||||
}
|
||||
else if (srcRaw <= 9+9+O9X_ARM_NUM_CSW+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10-9-O9X_ARM_NUM_CSW);
|
||||
else if (srcRaw <= 9+9+32+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10-9-32);
|
||||
}
|
||||
else if (srcRaw <= 9+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-10-9-O9X_ARM_NUM_CSW-NUM_CYC);
|
||||
else if (srcRaw <= 9+9+32+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-10-9-32-NUM_CYC);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-10-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-10-9-32-NUM_CYC-8);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
@@ -327,17 +327,17 @@ t_Open9xArmMixData_v209::operator MixData ()
|
||||
else if (srcRaw == 13) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW) {
|
||||
else if (srcRaw <= 13+9+32) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-13);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-O9X_ARM_NUM_CSW);
|
||||
else if (srcRaw <= 13+9+32+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-32);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC);
|
||||
else if (srcRaw <= 13+9+32+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-32-NUM_CYC);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-32-NUM_CYC-8);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
|
||||
@@ -393,17 +393,17 @@ t_Open9xArmMixData_v210::operator MixData ()
|
||||
else if (srcRaw == 13) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW) {
|
||||
else if (srcRaw <= 13+9+32) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-13);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-O9X_ARM_NUM_CSW);
|
||||
else if (srcRaw <= 13+9+32+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-14-9-32);
|
||||
}
|
||||
else if (srcRaw <= 13+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC);
|
||||
else if (srcRaw <= 13+9+32+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-14-9-32-NUM_CYC);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-14-9-32-NUM_CYC-8);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
|
||||
@@ -463,17 +463,17 @@ t_Open9xArmMixData_v212::operator MixData ()
|
||||
else if (srcRaw == 14) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 14+9+O9X_ARM_NUM_CSW) {
|
||||
else if (srcRaw <= 14+9+32) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-14);
|
||||
}
|
||||
else if (srcRaw <= 14+9+O9X_ARM_NUM_CSW+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-15-9-O9X_ARM_NUM_CSW);
|
||||
else if (srcRaw <= 14+9+32+NUM_CYC) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-15-9-32);
|
||||
}
|
||||
else if (srcRaw <= 14+9+O9X_ARM_NUM_CSW+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-15-9-O9X_ARM_NUM_CSW-NUM_CYC);
|
||||
else if (srcRaw <= 14+9+32+NUM_CYC+8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-15-9-32-NUM_CYC);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-15-9-O9X_ARM_NUM_CSW-NUM_CYC-8);
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-15-9-32-NUM_CYC-8);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
|
||||
@@ -738,7 +738,7 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -766,7 +766,7 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -777,29 +777,29 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -815,7 +815,7 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -827,7 +827,7 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -855,7 +855,7 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -866,29 +866,29 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -905,7 +905,7 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -917,7 +917,7 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -945,7 +945,7 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -956,29 +956,29 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -989,7 +989,7 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -1001,7 +1001,7 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1029,7 +1029,7 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1040,13 +1040,13 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_CURVES; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -1063,9 +1063,9 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1073,7 +1073,7 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -1085,7 +1085,7 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++) {
|
||||
for (int i=0; i<2; i++) {
|
||||
c9x.timers[i] = timers[i];
|
||||
c9x.timers[i].persistent = timersXtra[i].remanent;
|
||||
c9x.timers[i].val = timersXtra[i].value;
|
||||
@@ -1116,7 +1116,7 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<9; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1127,13 +1127,13 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_MAX_MIXERS; i++)
|
||||
for (int i=0; i<64; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_EXPOS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_ARM_MAX_CURVES; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -1150,9 +1150,9 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_ARM_NUM_CSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_ARM_NUM_FSW; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
|
||||
@@ -19,17 +19,6 @@
|
||||
|
||||
#include "open9xStockeeprom.h"
|
||||
|
||||
#define O9X_ARM_MAX_FLIGHT_MODES 9
|
||||
#define O9X_ARM_MAX_MIXERS 64
|
||||
#define O9X_ARM_MAX_EXPOS 32
|
||||
#define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16
|
||||
#define O9X_ARM_NUM_CSW 32 // number of custom switches
|
||||
#define O9X_ARM_NUM_FSW 32 // number of functions assigned to switches
|
||||
#define O9X_ARM_MAX_CURVES 16
|
||||
#define O9X_ARM_NUM_POINTS 512
|
||||
#define O9X_ARM_MAX_CSFUNCOLD 13
|
||||
#define O9X_ARM_MAX_CSFUNC 15
|
||||
|
||||
PACK(typedef struct t_Open9xArmTimerData_v202 {
|
||||
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
uint16_t val;
|
||||
@@ -326,7 +315,7 @@ PACK(typedef struct t_Open9xArmFrSkyData_v211 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -338,22 +327,22 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v208 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v208 mixData[64];
|
||||
Open9xLimitData_v201 limitData[32];
|
||||
Open9xArmExpoData_v208 expoData[32];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xArmLogicalSwitchData_v208 customSw[32];
|
||||
Open9xArmFuncSwData_v208 funcSw[32];
|
||||
Open9xArmSwashRingData_v208 swashR;
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[9];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
int8_t servoCenter[32];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -365,7 +354,7 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -377,22 +366,22 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v209 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v209 mixData[64];
|
||||
Open9xLimitData_v201 limitData[32];
|
||||
Open9xArmExpoData_v208 expoData[32];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xArmLogicalSwitchData_v209 customSw[32];
|
||||
Open9xArmFuncSwData_v208 funcSw[32];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[9];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
int8_t servoCenter[32];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -405,7 +394,7 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -417,20 +406,20 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v210 mixData[64];
|
||||
Open9xLimitData_v201 limitData[32];
|
||||
Open9xArmExpoData_v210 expoData[32];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[32];
|
||||
Open9xArmFuncSwData_v210 funcSw[32];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[9];
|
||||
Open9xArmFrSkyData_v210 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
int8_t servoCenter[32];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -444,7 +433,7 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -456,21 +445,21 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v210 mixData[64];
|
||||
Open9xLimitData_v201 limitData[32];
|
||||
Open9xArmExpoData_v210 expoData[32];
|
||||
int16_t curves[16];
|
||||
int8_t points[512];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[32];
|
||||
Open9xArmFuncSwData_v211 funcSw[32];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[9];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
int8_t servoCenter[32];
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
@@ -482,7 +471,7 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xArmTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -494,15 +483,15 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v212 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v211 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v212 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmMixData_v212 mixData[64];
|
||||
Open9xLimitData_v211 limitData[32];
|
||||
Open9xArmExpoData_v212 expoData[32];
|
||||
int16_t curves[16];
|
||||
int8_t points[512];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[32];
|
||||
Open9xArmFuncSwData_v211 funcSw[32];
|
||||
Open9xArmSwashRingData_v210 swashR;
|
||||
Open9xArmFlightModeData_v212 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v212 flightModeData[9];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -510,7 +499,7 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xArmFrSkyData_v211 frsky;
|
||||
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
|
||||
Open9xTimerDataExtra timersXtra[2];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xArmModelData_v212() { memset(this, 0, sizeof(t_Open9xArmModelData_v212)); }
|
||||
|
||||
@@ -568,7 +568,7 @@ t_Open9xFuncSwData_v201::operator FuncSwData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
c9x.func = (AssignFunc)(func+O9X_NUM_CHNOUT);
|
||||
c9x.func = (AssignFunc)(func+16);
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -943,7 +943,7 @@ t_Open9xModelData_v201::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -954,25 +954,25 @@ t_Open9xModelData_v201::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -980,7 +980,7 @@ t_Open9xModelData_v201::operator ModelData ()
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
// for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
// for (int i=0; i<16; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1017,7 +1017,7 @@ t_Open9xModelData_v202::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1028,25 +1028,25 @@ t_Open9xModelData_v202::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1054,7 +1054,7 @@ t_Open9xModelData_v202::operator ModelData ()
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
// for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
// for (int i=0; i<16; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1093,7 +1093,7 @@ t_Open9xModelData_v203::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1104,31 +1104,31 @@ t_Open9xModelData_v203::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1167,7 +1167,7 @@ t_Open9xModelData_v204::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1178,31 +1178,31 @@ t_Open9xModelData_v204::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1219,7 +1219,7 @@ t_Open9xModelData_v205::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1246,7 +1246,7 @@ t_Open9xModelData_v205::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1257,31 +1257,31 @@ t_Open9xModelData_v205::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1304,7 +1304,7 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1332,7 +1332,7 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1343,31 +1343,31 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1385,7 +1385,7 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -1397,7 +1397,7 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1425,7 +1425,7 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1436,31 +1436,31 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int i=0; i<8; i++) {
|
||||
c9x.curves[8 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
c9x.curves[8 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[8 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1479,7 +1479,7 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -1491,7 +1491,7 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1519,7 +1519,7 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1530,14 +1530,14 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -1555,9 +1555,9 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
@@ -1567,7 +1567,7 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
c9x.limitData[i].ppmCenter=servoCenter[i];
|
||||
}
|
||||
|
||||
@@ -1579,7 +1579,7 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
@@ -1607,7 +1607,7 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
@@ -1618,14 +1618,14 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
for (int i=0; i<32; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
for (int i=0; i<14; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
@@ -1643,9 +1643,9 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
for (int i=0; i<12; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
for (int i=0; i<16; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
|
||||
@@ -481,20 +481,6 @@ PACK(typedef struct t_Open9xTimerDataExtra {
|
||||
t_Open9xTimerDataExtra() { memset(this, 0, sizeof(t_Open9xTimerDataExtra)); }
|
||||
}) Open9xTimerDataExtra;
|
||||
|
||||
#define O9X_MAX_TIMERS 2
|
||||
#define O9X_MAX_FLIGHT_MODES 5
|
||||
#define O9X_MAX_MIXERS 32
|
||||
#define O9X_MAX_EXPOS 14
|
||||
#define O9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define O9X_NUM_CSW 12 // number of custom switches
|
||||
#define O9X_NUM_FSW 16 // number of functions assigned to switches
|
||||
#define O9X_MAX_CURVES 8
|
||||
#define O9X_NUM_POINTS (112-O9X_MAX_CURVES)
|
||||
#define O9X_MAX_GVARS 5
|
||||
|
||||
#define O9X_209_MAX_CURVE5 8
|
||||
#define O9X_209_MAX_CURVE9 8
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v201 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v201 timer1;
|
||||
@@ -511,16 +497,16 @@ PACK(typedef struct t_Open9xModelData_v201 {
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v201 timer2;
|
||||
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xMixData_v201 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[12];
|
||||
Open9xSafetySwData safetySw[16];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v201 frsky;
|
||||
|
||||
operator ModelData();
|
||||
@@ -542,16 +528,16 @@ PACK(typedef struct t_Open9xModelData_v202 {
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v202 timer2;
|
||||
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xMixData_v201 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[12];
|
||||
Open9xSafetySwData safetySw[16];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v202 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -576,15 +562,15 @@ PACK(typedef struct t_Open9xModelData_v203 {
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v202 timer2;
|
||||
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v203 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[12];
|
||||
Open9xFuncSwData_v203 funcSw[16];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v202 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -609,15 +595,15 @@ PACK(typedef struct t_Open9xModelData_v204 {
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v202 timer2;
|
||||
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v203 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[12];
|
||||
Open9xFuncSwData_v203 funcSw[16];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v204 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -630,7 +616,7 @@ PACK(typedef struct t_Open9xModelData_v204 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v205 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -642,22 +628,22 @@ PACK(typedef struct t_Open9xModelData_v205 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v205 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[12];
|
||||
Open9xFuncSwData_v203 funcSw[16];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v205 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v205() { memset(this, 0, sizeof(t_Open9xModelData_v205)); }
|
||||
@@ -665,7 +651,7 @@ PACK(typedef struct t_Open9xModelData_v205 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v208 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -677,22 +663,22 @@ PACK(typedef struct t_Open9xModelData_v208 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v205 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[12];
|
||||
Open9xFuncSwData_v203 funcSw[16];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -704,7 +690,7 @@ PACK(typedef struct t_Open9xModelData_v208 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v209 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -716,22 +702,22 @@ PACK(typedef struct t_Open9xModelData_v209 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v209 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves5[8][5];
|
||||
int8_t curves9[8][9];
|
||||
Open9xLogicalSwitchData_v209 customSw[12];
|
||||
Open9xFuncSwData_v203 funcSw[16];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
@@ -744,7 +730,7 @@ PACK(typedef struct t_Open9xModelData_v209 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v210 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -756,21 +742,21 @@ PACK(typedef struct t_Open9xModelData_v210 {
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v209 mixData[32];
|
||||
Open9xLimitData_v201 limitData[16];
|
||||
Open9xExpoData_v201 expoData[14];
|
||||
int8_t curves[8];
|
||||
int8_t points[112-8];
|
||||
Open9xLogicalSwitchData_v209 customSw[12];
|
||||
Open9xFuncSwData_v210 funcSw[16];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
int8_t servoCenter[16];
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
@@ -782,7 +768,7 @@ PACK(typedef struct t_Open9xModelData_v210 {
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v211 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
Open9xTimerData_v202 timers[2];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
@@ -794,15 +780,15 @@ PACK(typedef struct t_Open9xModelData_v211 {
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v211 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xMixData_v211 mixData[32];
|
||||
Open9xLimitData_v211 limitData[16];
|
||||
Open9xExpoData_v211 expoData[14];
|
||||
int8_t curves[8];
|
||||
int8_t points[112-8];
|
||||
Open9xLogicalSwitchData_v209 customSw[12];
|
||||
Open9xFuncSwData_v210 funcSw[16];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[5];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
#define MAX_SWITCHES_POSITION(board) (IS_TARANIS(board) ? 22 : 9)
|
||||
#define MAX_ROTARY_ENCODERS(board) (board==BOARD_GRUVIN9X ? 2 : (IS_SKY9X(board) ? 1 : 0))
|
||||
#define MAX_FLIGHT_MODES(board, version) (IS_ARM(board) ? 9 : (IS_DBLRAM(board, version) ? 6 : 5))
|
||||
#define MAX_TIMERS(board, version) ((IS_ARM(board) && version >= 217) ? 3 : 2)
|
||||
#define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32)
|
||||
#define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16)
|
||||
#define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14))
|
||||
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
|
||||
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16))
|
||||
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : O9X_MAX_CURVES)
|
||||
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : 8)
|
||||
#define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5)
|
||||
#define NUM_PPM_INPUTS(board, version) ((IS_ARM(board) && version >= 216) ? 16 : 8)
|
||||
|
||||
@@ -1239,7 +1240,7 @@ class CurvesField: public TransformedField {
|
||||
board(board),
|
||||
version(version),
|
||||
maxCurves(MAX_CURVES(board, version)),
|
||||
maxPoints(IS_ARM(board) ? O9X_ARM_NUM_POINTS : O9X_NUM_POINTS)
|
||||
maxPoints(IS_ARM(board) ? 512 : 112-8)
|
||||
{
|
||||
for (int i=0; i<maxCurves; i++) {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
@@ -2426,9 +2427,17 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
internalField.Append(new CharField<10>(modelData.bitmap));
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++) {
|
||||
for (int i=0; i<MAX_TIMERS(board, version); i++) {
|
||||
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
|
||||
if ((IS_ARM(board) || IS_2560(board)) && version >= 216) {
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
|
||||
internalField.Append(new UnsignedField<2>(modelData.timers[i].persistent));
|
||||
internalField.Append(new SpareBitsField<3>());
|
||||
internalField.Append(new UnsignedField<32>(modelData.timers[i].val));
|
||||
internalField.Append(new SignedField<32>(modelData.timers[i].pvalue));
|
||||
}
|
||||
else if ((IS_ARM(board) || IS_2560(board)) && version >= 216) {
|
||||
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
|
||||
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
|
||||
|
||||
@@ -31,26 +31,6 @@
|
||||
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
|
||||
#define SIMU_M128_VARIANTS (M128_VARIANT|SIMU_STOCK_VARIANTS)
|
||||
|
||||
#define O9X_MAX_TIMERS 2
|
||||
#define O9X_MAX_FLIGHT_MODES 5
|
||||
#define O9X_MAX_MIXERS 32
|
||||
#define O9X_MAX_EXPOS 14
|
||||
#define O9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define O9X_NUM_CSW 12 // number of custom switches
|
||||
#define O9X_NUM_FSW 16 // number of functions assigned to switches
|
||||
#define O9X_MAX_CURVES 8
|
||||
#define O9X_NUM_POINTS (112-O9X_MAX_CURVES)
|
||||
|
||||
#define O9X_ARM_MAX_FLIGHT_MODES 9
|
||||
#define O9X_ARM_MAX_MIXERS 64
|
||||
#define O9X_ARM_MAX_EXPOS 32
|
||||
#define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16
|
||||
#define O9X_ARM_NUM_CSW 32 // number of custom switches
|
||||
#define O9X_ARM_NUM_FSW 32 // number of functions assigned to switches
|
||||
#define O9X_ARM_NUM_POINTS 512
|
||||
#define O9X_ARM_MAX_CSFUNCOLD 13
|
||||
#define O9X_ARM_MAX_CSFUNC 15
|
||||
|
||||
class OpenTxGeneralData: public TransformedField {
|
||||
public:
|
||||
OpenTxGeneralData(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant=0);
|
||||
|
||||
@@ -377,7 +377,7 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_SKY9X:
|
||||
case BOARD_9XRPRO:
|
||||
version = 216;
|
||||
version = 217;
|
||||
break;
|
||||
case BOARD_GRUVIN9X:
|
||||
case BOARD_MEGA2560:
|
||||
@@ -556,11 +556,11 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
case GvarsFlightModes:
|
||||
return ((IS_ARM(board) || board==BOARD_GRUVIN9X) ? 1 : 0);
|
||||
case Mixes:
|
||||
return (IS_ARM(board) ? O9X_ARM_MAX_MIXERS : O9X_MAX_MIXERS);
|
||||
return (IS_ARM(board) ? 64 : 32);
|
||||
case OffsetWeight:
|
||||
return (IS_ARM(board) ? 500 : 245);
|
||||
case Timers:
|
||||
return 2;
|
||||
return (IS_ARM(board) ? 3 : 2);
|
||||
case PermTimers:
|
||||
if (board == BOARD_GRUVIN9X || IS_ARM(board))
|
||||
return 1;
|
||||
@@ -601,7 +601,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
else
|
||||
return 0;
|
||||
case Outputs:
|
||||
return (IS_ARM(board) ? O9X_ARM_NUM_CHNOUT : O9X_NUM_CHNOUT);
|
||||
return (IS_ARM(board) ? 32 : 16);
|
||||
case NumCurvePoints:
|
||||
return (IS_ARM(board) ? 512 : 104);
|
||||
case VoicesAsNumbers:
|
||||
|
||||
@@ -345,9 +345,16 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
ui->name->setMaxLength(IS_TARANIS(firmware->getBoard()) ? 12 : 10);
|
||||
|
||||
for (int i=0; i<C9X_MAX_TIMERS; i++) {
|
||||
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware);
|
||||
ui->gridLayout->addWidget(timers[i], 1+i, 1);
|
||||
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
|
||||
if (i<firmware->getCapability(Timers)) {
|
||||
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware);
|
||||
ui->gridLayout->addWidget(timers[i], 1+i, 1);
|
||||
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
|
||||
}
|
||||
else {
|
||||
foreach(QLabel *label, findChildren<QLabel *>(QRegExp(QString("label_timer%1").arg(i+1)))) {
|
||||
label->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<firmware->getCapability(NumModules); i++) {
|
||||
@@ -625,7 +632,7 @@ void SetupPanel::update()
|
||||
updatePotWarnings();
|
||||
}
|
||||
|
||||
for (int i=0; i<C9X_MAX_TIMERS; i++)
|
||||
for (int i=0; i<firmware->getCapability(Timers); i++)
|
||||
timers[i]->update();
|
||||
|
||||
for (int i=0; i<C9X_NUM_MODULES+1; i++)
|
||||
|
||||
@@ -16,7 +16,55 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="4" column="1">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_timer3">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Timer 3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_timer1">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Timer 1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" alignment="Qt::AlignRight|Qt::AlignVCenter">
|
||||
<widget class="QLabel" name="label_timer2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Timer 2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="3">
|
||||
<widget class="QCheckBox" name="throttleReverse">
|
||||
@@ -144,39 +192,7 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" alignment="Qt::AlignRight|Qt::AlignVCenter">
|
||||
<widget class="QLabel" name="label_timer2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Timer 2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" alignment="Qt::AlignRight|Qt::AlignVCenter">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Timer 1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_ttrace">
|
||||
@@ -212,14 +228,14 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="7" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="centerBeepLayout"/>
|
||||
@@ -239,14 +255,14 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="font">
|
||||
<font>
|
||||
@@ -262,7 +278,7 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -370,7 +386,7 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="0" alignment="Qt::AlignLeft|Qt::AlignTop">
|
||||
<item row="9" column="0" alignment="Qt::AlignLeft|Qt::AlignTop">
|
||||
<widget class="QLabel" name="swwarn_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
@@ -392,7 +408,7 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<item row="9" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
|
||||
Reference in New Issue
Block a user