Renaming started ... who wants to continue?

This commit is contained in:
Bertrand Songis
2014-02-08 08:38:06 +01:00
parent afc3b61232
commit 08a37b77e7
40 changed files with 577 additions and 563 deletions
+5 -5
View File
@@ -168,7 +168,7 @@ PACK(typedef struct {
int16_t curves[16];
int8_t points[NUM_POINTS];
CustomSwData customSw[NUM_CSW];
LogicalSwitchData customSw[NUM_CSW];
CustomFnData funcSw[NUM_CFN];
SwashRingData swashR;
PhaseData_v215 phaseData[MAX_PHASES];
@@ -379,13 +379,13 @@ void ConvertModel_215_to_216(ModelData &model)
for (uint8_t i=0; i<32; i++) {
g_model.customSw[i] = oldModel.customSw[i];
#if defined(PCBTARANIS)
CustomSwData * cs = &g_model.customSw[i];
LogicalSwitchData * cs = &g_model.customSw[i];
uint8_t cstate = cswFamily(cs->func);
if (cstate == CS_FAMILY_OFS || cstate == CS_FAMILY_COMP || cstate == CS_FAMILY_DIFF) {
if (cstate == LS_FAMILY_OFS || cstate == LS_FAMILY_COMP || cstate == LS_FAMILY_DIFF) {
if (cs->v1 > 0) cs->v1 += MAX_INPUTS + MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS;
if (cs->v1 > MIXSRC_GVAR1+4) cs->v1 += 4;
}
if (cstate == CS_FAMILY_OFS || cstate == CS_FAMILY_DIFF) {
if (cstate == LS_FAMILY_OFS || cstate == LS_FAMILY_DIFF) {
if (cs->v1 >= MIXSRC_FIRST_TELEM) {
switch ((uint8_t)cs->v1) {
case MIXSRC_FIRST_TELEM + TELEM_TM1-1:
@@ -429,7 +429,7 @@ void ConvertModel_215_to_216(ModelData &model)
}
}
}
if (cstate == CS_FAMILY_COMP) {
if (cstate == LS_FAMILY_COMP) {
if (cs->v2 > 0) cs->v2 += MAX_INPUTS + MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS;
if (cs->v2 > MIXSRC_GVAR1+4) cs->v2 += 4;
}
+4 -4
View File
@@ -304,8 +304,8 @@ TEST(getSwitch, circularCSW)
{
MODEL_RESET();
MIXER_RESET();
g_model.customSw[0] = { SWSRC_SW1, SWSRC_SW1, CS_OR };
g_model.customSw[1] = { SWSRC_SW1, SWSRC_SW1, CS_AND };
g_model.customSw[0] = { SWSRC_SW1, SWSRC_SW1, LS_FUNC_OR };
g_model.customSw[1] = { SWSRC_SW1, SWSRC_SW1, LS_FUNC_AND };
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
EXPECT_EQ(getSwitch(-SWSRC_SW1), true);
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
@@ -324,8 +324,8 @@ TEST(getSwitch, recursiveSW)
MODEL_RESET();
MIXER_RESET();
g_model.customSw[0] = { SWSRC_RUD, -SWSRC_SW2, CS_OR };
g_model.customSw[1] = { SWSRC_ELE, -SWSRC_SW1, CS_OR };
g_model.customSw[0] = { SWSRC_RUD, -SWSRC_SW2, LS_FUNC_OR };
g_model.customSw[1] = { SWSRC_ELE, -SWSRC_SW1, LS_FUNC_OR };
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
+87 -87
View File
@@ -55,7 +55,7 @@ enum EnumTabModel {
#if LCD_W >= 212
IF_GVARS(e_GVars)
#endif
e_CustomSwitches,
e_LogicalSwitches,
e_CustomFunctions,
#if defined(LUA_MODEL_SCRIPTS)
e_CustomScripts,
@@ -74,7 +74,7 @@ void menuModelMixAll(uint8_t event);
void menuModelLimits(uint8_t event);
void menuModelCurvesAll(uint8_t event);
void menuModelGVars(uint8_t event);
void menuModelCustomSwitches(uint8_t event);
void menuModelLogicalSwitches(uint8_t event);
void menuModelCustomFunctions(uint8_t event);
void menuModelCustomScripts(uint8_t event);
void menuModelTelemetry(uint8_t event);
@@ -93,7 +93,7 @@ const MenuFuncP_PROGMEM menuTabModel[] PROGMEM = {
#if LCD_W >= 212 && defined(GVARS) && defined(FLIGHT_MODES)
IF_GVARS(menuModelGVars)
#endif
menuModelCustomSwitches,
menuModelLogicalSwitches,
menuModelCustomFunctions,
#if defined(LUA_MODEL_SCRIPTS)
menuModelCustomScripts,
@@ -4124,20 +4124,20 @@ void menuModelGVars(uint8_t event)
#define CHECK_INCDEC_PARAM(event, var, min, max) checkIncDec(event, var, min, max, incdecFlag)
#endif
enum CustomSwitchFields {
CSW_FIELD_FUNCTION,
CSW_FIELD_V1,
CSW_FIELD_V2,
enum LogicalSwitchFields {
LS_FIELD_FUNCTION,
LS_FIELD_V1,
LS_FIELD_V2,
#if defined(PCBTARANIS)
CSW_FIELD_V3,
LS_FIELD_V3,
#endif
CSW_FIELD_ANDSW,
LS_FIELD_ANDSW,
#if defined(CPUARM)
CSW_FIELD_DURATION,
CSW_FIELD_DELAY,
LS_FIELD_DURATION,
LS_FIELD_DELAY,
#endif
CSW_FIELD_COUNT,
CSW_FIELD_LAST = CSW_FIELD_COUNT-1
LS_FIELD_COUNT,
LS_FIELD_LAST = LS_FIELD_COUNT-1
};
#if LCD_W >= 212
@@ -4158,15 +4158,15 @@ enum CustomSwitchFields {
#define CSWONE_2ND_COLUMN (11*FW)
void menuModelCustomSwitchOne(uint8_t event)
void menuModelLogicalSwitchOne(uint8_t event)
{
TITLE(STR_MENUCUSTOMSWITCH);
CustomSwData * cs = cswAddress(s_currIdx);
LogicalSwitchData * cs = cswAddress(s_currIdx);
uint8_t sw = SWSRC_SW1+s_currIdx;
putsSwitches(14*FW, 0, sw, (getSwitch(sw) ? BOLD : 0));
SUBMENU_NOTITLE(CSW_FIELD_COUNT, {0, 0, 1, 0 /*, 0...*/});
SUBMENU_NOTITLE(LS_FIELD_COUNT, {0, 0, 1, 0 /*, 0...*/});
int8_t sub = m_posVert;
@@ -4176,17 +4176,17 @@ void menuModelCustomSwitchOne(uint8_t event)
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
uint8_t cstate = cswFamily(cs->func);
switch(i) {
case CSW_FIELD_FUNCTION:
case LS_FIELD_FUNCTION:
lcd_putsLeft(y, STR_FUNC);
lcd_putsiAtt(CSWONE_2ND_COLUMN, y, STR_VCSWFUNC, cs->func, attr);
if (attr) {
cs->func = checkIncDec(event, cs->func, 0, CS_MAXF, EE_MODEL, isFunctionAvailable);
cs->func = checkIncDec(event, cs->func, 0, LS_FUNC_MAX, EE_MODEL, isLogicalSwitchFunctionAvailable);
uint8_t new_cstate = cswFamily(cs->func);
if (cstate != new_cstate) {
if (new_cstate == CS_FAMILY_TIMER) {
if (new_cstate == LS_FAMILY_TIMER) {
cs->v1 = cs->v2 = -119;
}
else if (new_cstate == CS_FAMILY_STAY) {
else if (new_cstate == LS_FAMILY_STAY) {
cs->v1 = 0; cs->v2 = -129; cs->v3 = 0;
}
else {
@@ -4195,15 +4195,15 @@ void menuModelCustomSwitchOne(uint8_t event)
}
}
break;
case CSW_FIELD_V1:
case LS_FIELD_V1:
{
lcd_putsLeft(y, STR_V1);
int8_t v1_min=0, v1_max=MIXSRC_LAST_TELEM;
if (cstate == CS_FAMILY_BOOL || cstate == CS_FAMILY_STICKY || cstate == CS_FAMILY_STAY) {
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY || cstate == LS_FAMILY_STAY) {
putsSwitches(CSWONE_2ND_COLUMN, y, cs->v1, attr);
v1_min = SWSRC_OFF+1; v1_max = SWSRC_ON-1;
}
else if (cstate == CS_FAMILY_TIMER) {
else if (cstate == LS_FAMILY_TIMER) {
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, cs->v1+1, LEFT|attr);
v1_max = 99;
}
@@ -4215,19 +4215,19 @@ void menuModelCustomSwitchOne(uint8_t event)
}
break;
}
case CSW_FIELD_V2:
case LS_FIELD_V2:
{
lcd_putsLeft(y, STR_V2);
int16_t v2_min=0, v2_max=MIXSRC_LAST_TELEM;
if (cstate == CS_FAMILY_BOOL || cstate == CS_FAMILY_STICKY) {
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
putsSwitches(CSWONE_2ND_COLUMN, y, cs->v2, attr);
v2_min = SWSRC_OFF+1; v2_max = SWSRC_ON-1;
}
else if (cstate == CS_FAMILY_TIMER) {
else if (cstate == LS_FAMILY_TIMER) {
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, cs->v2+1, LEFT|attr);
v2_max = 99;
}
else if (cstate == CS_FAMILY_STAY) {
else if (cstate == LS_FAMILY_STAY) {
lcd_putc(CSWONE_2ND_COLUMN-4, y, '[');
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, cswTimerValue(cs->v2), LEFT|PREC1|(m_posHorz==0 ? attr : 0));
lcd_putc(lcdLastPos, y, ':');
@@ -4243,7 +4243,7 @@ void menuModelCustomSwitchOne(uint8_t event)
}
v2_min=-129; v2_max = 122;
}
else if (cstate == CS_FAMILY_COMP) {
else if (cstate == LS_FAMILY_COMP) {
putsMixerSource(CSWONE_2ND_COLUMN, y, cs->v2, attr);
}
else {
@@ -4251,7 +4251,7 @@ void menuModelCustomSwitchOne(uint8_t event)
if (cs->v1 >= MIXSRC_FIRST_TELEM) {
putsTelemetryChannel(CSWONE_2ND_COLUMN, y, cs->v1 - MIXSRC_FIRST_TELEM, convertCswTelemValue(cs), attr|LEFT);
v2_max = maxTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1);
if (cstate == CS_FAMILY_OFS) {
if (cstate == LS_FAMILY_OFS) {
v2_min = -128;
v2_max -= 128;
}
@@ -4277,34 +4277,34 @@ void menuModelCustomSwitchOne(uint8_t event)
}
break;
}
case CSW_FIELD_ANDSW:
case LS_FIELD_ANDSW:
lcd_putsLeft(y, STR_AND_SWITCH);
putsSwitches(CSWONE_2ND_COLUMN, y, cs->andsw, attr);
if (attr) CHECK_INCDEC_MODELVAR(event, cs->andsw, -MAX_CSW_ANDSW, MAX_CSW_ANDSW);
if (attr) CHECK_INCDEC_MODELVAR(event, cs->andsw, -MAX_LS_ANDSW, MAX_LS_ANDSW);
break;
case CSW_FIELD_DURATION:
case LS_FIELD_DURATION:
lcd_putsLeft(y, STR_DURATION);
if (cs->duration > 0)
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, 5*cs->duration, attr|PREC1|LEFT);
else
lcd_putsiAtt(CSWONE_2ND_COLUMN, y, STR_MMMINV, 0, attr);
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, cs->duration, MAX_CSW_DURATION);
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, cs->duration, MAX_LS_DURATION);
break;
case CSW_FIELD_DELAY:
case LS_FIELD_DELAY:
lcd_putsLeft(y, STR_DELAY);
if (cs->delay > 0)
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, 5*cs->delay, attr|PREC1|LEFT);
else
lcd_putsiAtt(CSWONE_2ND_COLUMN, y, STR_MMMINV, 0, attr);
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, cs->delay, MAX_CSW_DELAY);
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, cs->delay, MAX_LS_DELAY);
break;
}
}
}
void menuModelCustomSwitches(uint8_t event)
void menuModelLogicalSwitches(uint8_t event)
{
SIMPLE_MENU(STR_MENUCUSTOMSWITCHES, menuTabModel, e_CustomSwitches, NUM_CSW+1);
SIMPLE_MENU(STR_MENUCUSTOMSWITCHES, menuTabModel, e_LogicalSwitches, NUM_CSW+1);
uint8_t y = 0;
uint8_t k = 0;
@@ -4318,7 +4318,7 @@ void menuModelCustomSwitches(uint8_t event)
case EVT_KEY_FIRST(KEY_ENTER):
if (sub >= 0) {
s_currIdx = sub;
pushMenu(menuModelCustomSwitchOne);
pushMenu(menuModelLogicalSwitchOne);
}
break;
}
@@ -4326,7 +4326,7 @@ void menuModelCustomSwitches(uint8_t event)
for (uint8_t i=0; i<LCD_LINES-1; i++) {
y = 1 + (i+1)*FH;
k = i+s_pgOfs;
CustomSwData * cs = cswAddress(k);
LogicalSwitchData * cs = cswAddress(k);
// CSW name
uint8_t sw = SWSRC_SW1+k;
@@ -4340,15 +4340,15 @@ void menuModelCustomSwitches(uint8_t event)
// CSW params
uint8_t cstate = cswFamily(cs->func);
if (cstate == CS_FAMILY_BOOL || cstate == CS_FAMILY_STICKY) {
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
putsSwitches(CSW_2ND_COLUMN, y, cs->v1, 0);
putsSwitches(CSW_3RD_COLUMN, y, cs->v2, 0);
}
else if (cstate == CS_FAMILY_COMP) {
else if (cstate == LS_FAMILY_COMP) {
putsMixerSource(CSW_2ND_COLUMN, y, cs->v1, 0);
putsMixerSource(CSW_3RD_COLUMN, y, cs->v2, 0);
}
else if (cstate == CS_FAMILY_STAY) {
else if (cstate == LS_FAMILY_STAY) {
putsSwitches(CSW_2ND_COLUMN, y, cs->v1, 0);
lcd_putc(CSW_3RD_COLUMN-4, y, '[');
lcd_outdezAtt(CSW_3RD_COLUMN, y, cswTimerValue(cs->v2), LEFT|PREC1);
@@ -4359,7 +4359,7 @@ void menuModelCustomSwitches(uint8_t event)
lcd_outdezAtt(lcdLastPos+3, y, cswTimerValue(cs->v2+cs->v3), LEFT|PREC1);
lcd_putc(lcdLastPos-1, y, ']');
}
else if (cstate == CS_FAMILY_TIMER) {
else if (cstate == LS_FAMILY_TIMER) {
lcd_outdezAtt(CSW_2ND_COLUMN, y, cs->v1+1, LEFT);
lcd_outdezAtt(CSW_3RD_COLUMN, y, cs->v2+1, LEFT);
}
@@ -4391,17 +4391,17 @@ enum ClipboardType {
struct Clipboard {
ClipboardType type;
union {
CustomSwData csw;
LogicalSwitchData csw;
CustomFnData cfn;
} data;
};
Clipboard clipboard;
void onCustomSwitchesMenu(const char *result)
void onLogicalSwitchesMenu(const char *result)
{
int8_t sub = m_posVert-1;
CustomSwData * cs = cswAddress(sub);
LogicalSwitchData * cs = cswAddress(sub);
if (result == STR_COPY) {
clipboard.type = CLIPBOARD_TYPE_CUSTOM_SWITCH;
@@ -4412,17 +4412,17 @@ void onCustomSwitchesMenu(const char *result)
eeDirty(EE_MODEL);
}
else if (result == STR_DELETE) {
memset(cs, 0, sizeof(CustomSwData));
memset(cs, 0, sizeof(LogicalSwitchData));
eeDirty(EE_MODEL);
}
}
#endif
void menuModelCustomSwitches(uint8_t event)
void menuModelLogicalSwitches(uint8_t event)
{
INCDEC_DECLARE_VARS();
MENU(STR_MENUCUSTOMSWITCHES, menuTabModel, e_CustomSwitches, NUM_CSW+1, {0, NAVIGATION_LINE_BY_LINE|CSW_FIELD_LAST/*repeated...*/});
MENU(STR_MENUCUSTOMSWITCHES, menuTabModel, e_LogicalSwitches, NUM_CSW+1, {0, NAVIGATION_LINE_BY_LINE|LS_FIELD_LAST/*repeated...*/});
uint8_t y = 0;
uint8_t k = 0;
@@ -4438,12 +4438,12 @@ void menuModelCustomSwitches(uint8_t event)
#if defined(PCBTARANIS)
if (sub>=0 && horz<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
killEvents(event);
CustomSwData * cs = cswAddress(sub);
LogicalSwitchData * cs = cswAddress(sub);
if (cs->func) MENU_ADD_ITEM(STR_COPY);
if (clipboard.type == CLIPBOARD_TYPE_CUSTOM_SWITCH)
MENU_ADD_ITEM(STR_PASTE);
if (cs->func || cs->v1 || cs->v2 || cs->delay || cs->duration || cs->andsw) MENU_ADD_ITEM(STR_DELETE);
menuHandler = onCustomSwitchesMenu;
menuHandler = onLogicalSwitchesMenu;
}
#endif
@@ -4453,7 +4453,7 @@ void menuModelCustomSwitches(uint8_t event)
uint8_t attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
uint8_t attr1 = (horz==1 ? attr : 0);
uint8_t attr2 = (horz==2 ? attr : 0);
CustomSwData * cs = cswAddress(k);
LogicalSwitchData * cs = cswAddress(k);
// CSW name
uint8_t sw = SWSRC_SW1+k;
@@ -4471,24 +4471,24 @@ void menuModelCustomSwitches(uint8_t event)
int8_t v1_min=0, v1_max=MIXSRC_LAST_TELEM, v2_min=0, v2_max=MIXSRC_LAST_TELEM;
#endif
if (cstate == CS_FAMILY_BOOL || cstate == CS_FAMILY_STICKY) {
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
putsSwitches(CSW_2ND_COLUMN, y, cs->v1, attr1);
putsSwitches(CSW_3RD_COLUMN, y, cs->v2, attr2);
v1_min = SWSRC_OFF+1; v1_max = SWSRC_ON-1;
v2_min = SWSRC_OFF+1; v2_max = SWSRC_ON-1;
INCDEC_SET_FLAG(INCDEC_SWITCH);
INCDEC_ENABLE_CHECK(isSwitchAvailableInCustomSwitches);
INCDEC_ENABLE_CHECK(isSwitchAvailableInLogicalSwitches);
}
#if defined(CPUARM)
else if (cstate == CS_FAMILY_STAY) {
else if (cstate == LS_FAMILY_STAY) {
putsSwitches(CSW_2ND_COLUMN, y, cs->v1, attr1);
lcd_putc(CSW_3RD_COLUMN-4, y, '[');
lcd_outdezAtt(CSW_3RD_COLUMN, y, cswTimerValue(cs->v2), LEFT|PREC1|attr2);
lcd_putc(lcdLastPos, y, ':');
if (cs->v3 == 0)
lcd_putsAtt(lcdLastPos+3, y, "--", (horz==CSW_FIELD_V3 ? attr : 0));
lcd_putsAtt(lcdLastPos+3, y, "--", (horz==LS_FIELD_V3 ? attr : 0));
else
lcd_outdezAtt(lcdLastPos+3, y, cswTimerValue(cs->v2+cs->v3), LEFT|PREC1|(horz==CSW_FIELD_V3 ? attr : 0));
lcd_outdezAtt(lcdLastPos+3, y, cswTimerValue(cs->v2+cs->v3), LEFT|PREC1|(horz==LS_FIELD_V3 ? attr : 0));
lcd_putc(lcdLastPos, y, ']');
v1_min = SWSRC_OFF+1; v1_max = SWSRC_ON-1;
v2_min=-129; v2_max = 122;
@@ -4503,13 +4503,13 @@ void menuModelCustomSwitches(uint8_t event)
}
}
#endif
else if (cstate == CS_FAMILY_COMP) {
else if (cstate == LS_FAMILY_COMP) {
putsMixerSource(CSW_2ND_COLUMN, y, cs->v1, attr1);
putsMixerSource(CSW_3RD_COLUMN, y, cs->v2, attr2);
INCDEC_SET_FLAG(INCDEC_SOURCE);
INCDEC_ENABLE_CHECK(isSourceAvailable);
}
else if (cstate == CS_FAMILY_TIMER) {
else if (cstate == LS_FAMILY_TIMER) {
lcd_outdezAtt(CSW_2ND_COLUMN, y, cswTimerValue(cs->v1), LEFT|PREC1|attr1);
lcd_outdezAtt(CSW_3RD_COLUMN, y, cswTimerValue(cs->v2), LEFT|PREC1|attr2);
v1_min = v2_min = -128;
@@ -4538,7 +4538,7 @@ void menuModelCustomSwitches(uint8_t event)
eeDirty(EE_MODEL);
}
#else
if (cstate == CS_FAMILY_OFS) {
if (cstate == LS_FAMILY_OFS) {
v2_min = -128;
v2_max -= 128;
}
@@ -4570,37 +4570,37 @@ void menuModelCustomSwitches(uint8_t event)
// CSW AND switch
#if defined(CPUARM)
putsSwitches(CSW_4TH_COLUMN, y, cs->andsw, horz==CSW_FIELD_ANDSW ? attr : 0);
putsSwitches(CSW_4TH_COLUMN, y, cs->andsw, horz==LS_FIELD_ANDSW ? attr : 0);
#else
uint8_t andsw = cs->andsw;
if (andsw > SWSRC_LAST_SWITCH) {
andsw += SWSRC_SW1-SWSRC_LAST_SWITCH-1;
}
putsSwitches(CSW_4TH_COLUMN, y, andsw, horz==CSW_FIELD_ANDSW ? attr : 0);
putsSwitches(CSW_4TH_COLUMN, y, andsw, horz==LS_FIELD_ANDSW ? attr : 0);
#endif
#if defined(CPUARM)
// CSW duration
if (cs->duration > 0)
lcd_outdezAtt(CSW_5TH_COLUMN, y, 5*cs->duration, (horz==CSW_FIELD_DURATION ? attr : 0)|PREC1|LEFT);
lcd_outdezAtt(CSW_5TH_COLUMN, y, 5*cs->duration, (horz==LS_FIELD_DURATION ? attr : 0)|PREC1|LEFT);
else
lcd_putsiAtt(CSW_5TH_COLUMN, y, STR_MMMINV, 0, horz==CSW_FIELD_DURATION ? attr : 0);
lcd_putsiAtt(CSW_5TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DURATION ? attr : 0);
// CSW delay
if (cstate == CS_FAMILY_STAY) {
if (cstate == LS_FAMILY_STAY) {
lcd_puts(CSW_6TH_COLUMN, y, "N/A");
if (attr && horz == CSW_FIELD_DELAY) {
if (attr && horz == LS_FIELD_DELAY) {
REPEAT_LAST_CURSOR_MOVE();
}
}
else if (cs->delay > 0) {
lcd_outdezAtt(CSW_6TH_COLUMN, y, 5*cs->delay, (horz==CSW_FIELD_DELAY ? attr : 0)|PREC1|LEFT);
lcd_outdezAtt(CSW_6TH_COLUMN, y, 5*cs->delay, (horz==LS_FIELD_DELAY ? attr : 0)|PREC1|LEFT);
}
else {
lcd_putsiAtt(CSW_6TH_COLUMN, y, STR_MMMINV, 0, horz==CSW_FIELD_DELAY ? attr : 0);
lcd_putsiAtt(CSW_6TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DELAY ? attr : 0);
}
if (attr && horz == CSW_FIELD_V3 && cstate != CS_FAMILY_STAY) {
if (attr && horz == LS_FIELD_V3 && cstate != LS_FAMILY_STAY) {
REPEAT_LAST_CURSOR_MOVE();
}
#endif
@@ -4608,38 +4608,38 @@ void menuModelCustomSwitches(uint8_t event)
if ((s_editMode>0 || p1valdiff) && attr) {
switch (horz) {
case CSW_FIELD_FUNCTION:
case LS_FIELD_FUNCTION:
{
#if defined(CPUARM)
cs->func = checkIncDec(event, cs->func, 0, CS_MAXF, EE_MODEL, isFunctionAvailable);
cs->func = checkIncDec(event, cs->func, 0, LS_FUNC_MAX, EE_MODEL, isLogicalSwitchFunctionAvailable);
#else
CHECK_INCDEC_MODELVAR_ZERO(event, cs->func, CS_MAXF);
CHECK_INCDEC_MODELVAR_ZERO(event, cs->func, LS_FUNC_MAX);
#endif
uint8_t new_cstate = cswFamily(cs->func);
if (cstate != new_cstate) {
#if defined(CPUARM)
if (new_cstate == CS_FAMILY_TIMER) {
if (new_cstate == LS_FAMILY_TIMER) {
cs->v1 = cs->v2 = -119;
}
else if (new_cstate == CS_FAMILY_STAY) {
else if (new_cstate == LS_FAMILY_STAY) {
cs->v1 = 0; cs->v2 = -129; cs->v3 = 0;
}
else {
cs->v1 = cs->v2 = 0;
}
#else
cs->v1 = cs->v2 = (new_cstate==CS_FAMILY_TIMER ? -119/*1.0*/ : 0);
cs->v1 = cs->v2 = (new_cstate==LS_FAMILY_TIMER ? -119/*1.0*/ : 0);
#endif
}
break;
}
case CSW_FIELD_V1:
case LS_FIELD_V1:
cs->v1 = CHECK_INCDEC_PARAM(event, cs->v1, v1_min, v1_max);
break;
case CSW_FIELD_V2:
case LS_FIELD_V2:
cs->v2 = CHECK_INCDEC_PARAM(event, cs->v2, v2_min, v2_max);
#if defined(PCBTARANIS)
if (cstate==CS_FAMILY_OFS && cs->v1!=0 && event==EVT_KEY_LONG(KEY_ENTER)) {
if (cstate==LS_FAMILY_OFS && cs->v1!=0 && event==EVT_KEY_LONG(KEY_ENTER)) {
killEvents(event);
getvalue_t x = getValue(cs->v1);
if (cs->v1 < MIXSRC_GVAR1)
@@ -4651,25 +4651,25 @@ void menuModelCustomSwitches(uint8_t event)
#endif
break;
#if defined(CPUARM)
case CSW_FIELD_V3:
case LS_FIELD_V3:
cs->v3 = CHECK_INCDEC_PARAM(event, cs->v3, v3_min, v3_max);
break;
#endif
case CSW_FIELD_ANDSW:
case LS_FIELD_ANDSW:
#if defined(CPUARM)
INCDEC_SET_FLAG(INCDEC_SWITCH);
INCDEC_ENABLE_CHECK(isSwitchAvailableInCustomSwitches);
cs->andsw = CHECK_INCDEC_PARAM(event, cs->andsw, -MAX_CSW_ANDSW, MAX_CSW_ANDSW);
INCDEC_ENABLE_CHECK(isSwitchAvailableInLogicalSwitches);
cs->andsw = CHECK_INCDEC_PARAM(event, cs->andsw, -MAX_LS_ANDSW, MAX_LS_ANDSW);
#else
CHECK_INCDEC_MODELVAR_ZERO(event, cs->andsw, MAX_CSW_ANDSW);
CHECK_INCDEC_MODELVAR_ZERO(event, cs->andsw, MAX_LS_ANDSW);
#endif
break;
#if defined(CPUARM)
case CSW_FIELD_DURATION:
CHECK_INCDEC_MODELVAR_ZERO(event, cs->duration, MAX_CSW_DURATION);
case LS_FIELD_DURATION:
CHECK_INCDEC_MODELVAR_ZERO(event, cs->duration, MAX_LS_DURATION);
break;
case CSW_FIELD_DELAY:
CHECK_INCDEC_MODELVAR_ZERO(event, cs->delay, MAX_CSW_DELAY);
case LS_FIELD_DELAY:
CHECK_INCDEC_MODELVAR_ZERO(event, cs->delay, MAX_LS_DELAY);
break;
#endif
}
+21 -8
View File
@@ -1219,8 +1219,8 @@ bool isSourceAvailable(int16_t source)
}
if (source>=MIXSRC_SW1 && source<=MIXSRC_LAST_CSW) {
CustomSwData * cs = cswAddress(source-MIXSRC_SW1);
return (cs->func != CS_OFF);
LogicalSwitchData * cs = cswAddress(source-MIXSRC_SW1);
return (cs->func != LS_FUNC_NONE);
}
#if !defined(GVARS)
@@ -1248,7 +1248,7 @@ bool isInputSourceAvailable(int16_t source)
return false;
}
bool isSwitchAvailableInCustomSwitches(int16_t swtch)
bool isSwitchAvailableInLogicalSwitches(int16_t swtch)
{
if (swtch < 0) {
if (swtch <= -SWSRC_ON)
@@ -1279,22 +1279,35 @@ bool isSwitchAvailableInCustomSwitches(int16_t swtch)
bool isSwitchAvailable(int16_t swtch)
{
if (!isSwitchAvailableInCustomSwitches(swtch)) {
if (!isSwitchAvailableInLogicalSwitches(swtch)) {
return false;
}
if (swtch >= SWSRC_FIRST_CSW && swtch <= SWSRC_LAST_CSW) {
CustomSwData * cs = cswAddress(swtch-SWSRC_FIRST_CSW);
return (cs->func != CS_OFF);
LogicalSwitchData * cs = cswAddress(swtch-SWSRC_FIRST_CSW);
return (cs->func != LS_FUNC_NONE);
}
return true;
}
// Not available yet, will be needed if we implement the Range function later...
bool isFunctionAvailable(int16_t function)
bool isLogicalSwitchFunctionAvailable(int16_t function)
{
return function != CS_RANGE;
return function != LS_FUNC_RANGE;
}
bool isAssignableFunctionAvailable(int16_t function)
{
switch (function) {
#if !defined(HAPTIC)
case FUNC_HAPTIC:
return false;
#endif
default:
return true;
}
}
#endif
+3 -2
View File
@@ -190,9 +190,10 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
var = checkIncDecModelZero(event,var,max)
#if defined(CPUARM)
bool isFunctionAvailable(int16_t function);
bool isLogicalSwitchFunctionAvailable(int16_t function);
bool isAssignableFunctionAvailable(int16_t function);
bool isSwitchAvailable(int16_t swtch);
bool isSwitchAvailableInCustomSwitches(int16_t swtch);
bool isSwitchAvailableInLogicalSwitches(int16_t swtch);
#define AUTOSWITCH_ENTER_LONG() (attr && event==EVT_KEY_LONG(KEY_ENTER))
#define CHECK_INCDEC_MODELSWITCH(event, var, min, max) \
var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SWITCH|NO_INCDEC_MARKS, isSwitchAvailable)
+32 -32
View File
@@ -668,39 +668,39 @@ PACK( union u_int8int16_t {
#endif
enum CswFunctions {
CS_OFF,
CS_VEQUAL, // v==offset
CS_VPOS, // v>offset
CS_VNEG, // v<offset
enum LogicalSwitchesFunctions {
LS_FUNC_NONE,
LS_FUNC_VEQUAL, // v==offset
LS_FUNC_VPOS, // v>offset
LS_FUNC_VNEG, // v<offset
#if defined(CPUARM)
CS_RANGE,
LS_FUNC_RANGE,
#endif
CS_APOS, // |v|>offset
CS_ANEG, // |v|<offset
CS_AND,
CS_OR,
CS_XOR,
LS_FUNC_APOS, // |v|>offset
LS_FUNC_ANEG, // |v|<offset
LS_FUNC_AND,
LS_FUNC_OR,
LS_FUNC_XOR,
#if defined(CPUARM)
CS_STAY,
LS_FUNC_STAY,
#endif
CS_EQUAL,
CS_GREATER,
CS_LESS,
CS_DIFFEGREATER,
CS_ADIFFEGREATER,
CS_TIMER,
CS_STICKY,
CS_COUNT,
CS_MAXF = CS_COUNT-1
LS_FUNC_EQUAL,
LS_FUNC_GREATER,
LS_FUNC_LESS,
LS_FUNC_DIFFEGREATER,
LS_FUNC_ADIFFEGREATER,
LS_FUNC_TIMER,
LS_FUNC_STICKY,
LS_FUNC_COUNT,
LS_FUNC_MAX = LS_FUNC_COUNT-1
};
#if defined(CPUARM)
#define MAX_CSW_DURATION 120 /*60s*/
#define MAX_CSW_DELAY 120 /*60s*/
#define MAX_CSW_ANDSW SWSRC_LAST
typedef int16_t csw_telemetry_value_t;
PACK(typedef struct t_CustomSwData { // Custom Switches data
#define MAX_LS_DURATION 120 /*60s*/
#define MAX_LS_DELAY 120 /*60s*/
#define MAX_LS_ANDSW SWSRC_LAST
typedef int16_t ls_telemetry_value_t;
PACK(typedef struct t_LogicalSwitchData { // Custom Switches data
int8_t v1;
int16_t v2;
int16_t v3;
@@ -708,16 +708,16 @@ PACK(typedef struct t_CustomSwData { // Custom Switches data
uint8_t delay;
uint8_t duration;
int8_t andsw;
}) CustomSwData;
}) LogicalSwitchData;
#else
typedef uint8_t csw_telemetry_value_t;
#define MAX_CSW_ANDSW 15
PACK(typedef struct t_CustomSwData { // Custom Switches data
typedef uint8_t ls_telemetry_value_t;
#define MAX_LS_ANDSW 15
PACK(typedef struct t_LogicalSwitchData { // Custom Switches data
int8_t v1; //input
int8_t v2; //offset
uint8_t func:4;
uint8_t andsw:4;
}) CustomSwData;
}) LogicalSwitchData;
#endif
enum Functions {
@@ -1536,7 +1536,7 @@ PACK(typedef struct t_ModelData {
CURVDATA curves[MAX_CURVES];
int8_t points[NUM_POINTS];
CustomSwData customSw[NUM_CSW];
LogicalSwitchData customSw[NUM_CSW];
CustomFnData funcSw[NUM_CFN];
SwashRingData swashR;
PhaseData phaseData[MAX_PHASES];
+44 -44
View File
@@ -441,27 +441,27 @@ CurveInfo curveInfo(uint8_t idx)
}
#endif
CustomSwData *cswAddress(uint8_t idx)
LogicalSwitchData *cswAddress(uint8_t idx)
{
return &g_model.customSw[idx];
}
uint8_t cswFamily(uint8_t func)
{
if (func <= CS_ANEG)
return CS_FAMILY_OFS;
else if (func <= CS_XOR)
return CS_FAMILY_BOOL;
if (func <= LS_FUNC_ANEG)
return LS_FAMILY_OFS;
else if (func <= LS_FUNC_XOR)
return LS_FAMILY_BOOL;
#if defined(CPUARM)
else if (func == CS_STAY)
return CS_FAMILY_STAY;
else if (func == LS_FUNC_STAY)
return LS_FAMILY_STAY;
#endif
else if (func <= CS_LESS)
return CS_FAMILY_COMP;
else if (func <= CS_ADIFFEGREATER)
return CS_FAMILY_DIFF;
else if (func <= LS_FUNC_LESS)
return LS_FAMILY_COMP;
else if (func <= LS_FUNC_ADIFFEGREATER)
return LS_FAMILY_DIFF;
else
return CS_FAMILY_TIMER+func-CS_TIMER;
return LS_FAMILY_TIMER+func-LS_FUNC_TIMER;
}
int16_t cswTimerValue(delayval_t val)
@@ -1423,7 +1423,7 @@ bool getSwitch(int8_t swtch)
else {
s_last_switch_used |= mask;
CustomSwData * cs = cswAddress(cs_idx);
LogicalSwitchData * cs = cswAddress(cs_idx);
#if defined(CPUARM)
int8_t s = cs->andsw;
#else
@@ -1432,48 +1432,48 @@ bool getSwitch(int8_t swtch)
s += SWSRC_SW1-SWSRC_LAST_SWITCH-1;
}
#endif
if (cs->func == CS_OFF || (s && !getSwitch(s))) {
if (cs->func == LS_FUNC_NONE || (s && !getSwitch(s))) {
csLastValue[cs_idx] = CS_LAST_VALUE_INIT;
result = false;
}
else if ((s=cswFamily(cs->func)) == CS_FAMILY_BOOL) {
else if ((s=cswFamily(cs->func)) == LS_FAMILY_BOOL) {
bool res1 = getSwitch(cs->v1);
bool res2 = getSwitch(cs->v2);
switch (cs->func) {
case CS_AND:
case LS_FUNC_AND:
result = (res1 && res2);
break;
case CS_OR:
case LS_FUNC_OR:
result = (res1 || res2);
break;
// case CS_XOR:
// case LS_FUNC_XOR:
default:
result = (res1 ^ res2);
break;
}
}
else if (s == CS_FAMILY_TIMER) {
else if (s == LS_FAMILY_TIMER) {
result = (csLastValue[cs_idx] <= 0);
}
else if (s == CS_FAMILY_STICKY) {
else if (s == LS_FAMILY_STICKY) {
result = (csLastValue[cs_idx] & (1<<0));
}
#if defined(CPUARM)
else if (s == CS_FAMILY_STAY) {
else if (s == LS_FAMILY_STAY) {
result = (csLastValue[cs_idx] & (1<<0));
}
#endif
else {
getvalue_t x = getValue(cs->v1);
getvalue_t y;
if (s == CS_FAMILY_COMP) {
if (s == LS_FAMILY_COMP) {
y = getValue(cs->v2);
switch (cs->func) {
case CS_EQUAL:
case LS_FUNC_EQUAL:
result = (x==y);
break;
case CS_GREATER:
case LS_FUNC_GREATER:
result = (x>y);
break;
default:
@@ -1491,7 +1491,7 @@ bool getSwitch(int8_t swtch)
y = convertCswTelemValue(cs);
#if defined(FRSKY_HUB) && defined(GAUGES)
if (s == CS_FAMILY_OFS) {
if (s == LS_FAMILY_OFS) {
uint8_t idx = cs->v1-MIXSRC_FIRST_TELEM+1-TELEM_ALT;
if (idx < THLD_MAX) {
// Fill the threshold array
@@ -1519,7 +1519,7 @@ bool getSwitch(int8_t swtch)
#endif
switch (cs->func) {
case CS_VEQUAL:
case LS_FUNC_VEQUAL:
#if defined(GVARS)
if (cs->v1 >= MIXSRC_GVAR1 && cs->v1 <= MIXSRC_LAST_GVAR)
result = (x==y);
@@ -1527,16 +1527,16 @@ bool getSwitch(int8_t swtch)
#endif
result = (abs(x-y) < (1024 / STICK_TOLERANCE));
break;
case CS_VPOS:
case LS_FUNC_VPOS:
result = (x>y);
break;
case CS_VNEG:
case LS_FUNC_VNEG:
result = (x<y);
break;
case CS_APOS:
case LS_FUNC_APOS:
result = (abs(x)>y);
break;
case CS_ANEG:
case LS_FUNC_ANEG:
result = (abs(x)<y);
break;
default:
@@ -1544,7 +1544,7 @@ bool getSwitch(int8_t swtch)
if (csLastValue[cs_idx] == CS_LAST_VALUE_INIT)
csLastValue[cs_idx] = x;
int16_t diff = x - csLastValue[cs_idx];
if (cs->func == CS_DIFFEGREATER)
if (cs->func == LS_FUNC_DIFFEGREATER)
result = (y >= 0 ? (diff >= y) : (diff <= y));
else
result = (abs(diff) >= y);
@@ -1578,7 +1578,7 @@ bool getSwitch(int8_t swtch)
if (cswDurations[cs_idx] > get_tmr10ms()) {
result = true;
}
else if (s == CS_FAMILY_STICKY) {
else if (s == LS_FAMILY_STICKY) {
csLastValue[cs_idx] &= ~(1<<0);
}
}
@@ -1925,7 +1925,7 @@ void setGVarValue(uint8_t idx, int16_t value, int8_t phase)
#endif
#if defined(FRSKY)
csw_telemetry_value_t minTelemValue(uint8_t channel)
ls_telemetry_value_t minTelemValue(uint8_t channel)
{
switch (channel) {
case TELEM_FUEL:
@@ -1944,7 +1944,7 @@ csw_telemetry_value_t minTelemValue(uint8_t channel)
}
}
csw_telemetry_value_t maxTelemValue(uint8_t channel)
ls_telemetry_value_t maxTelemValue(uint8_t channel)
{
switch (channel) {
case TELEM_FUEL:
@@ -1965,7 +1965,7 @@ csw_telemetry_value_t maxTelemValue(uint8_t channel)
#endif
#if defined(CPUARM)
getvalue_t convert16bitsTelemValue(uint8_t channel, csw_telemetry_value_t value)
getvalue_t convert16bitsTelemValue(uint8_t channel, ls_telemetry_value_t value)
{
getvalue_t result;
switch (channel) {
@@ -1979,13 +1979,13 @@ getvalue_t convert16bitsTelemValue(uint8_t channel, csw_telemetry_value_t value)
return result;
}
csw_telemetry_value_t max8bitsTelemValue(uint8_t channel)
ls_telemetry_value_t max8bitsTelemValue(uint8_t channel)
{
return min<csw_telemetry_value_t>(255, maxTelemValue(channel));
return min<ls_telemetry_value_t>(255, maxTelemValue(channel));
}
#endif
getvalue_t convert8bitsTelemValue(uint8_t channel, csw_telemetry_value_t value)
getvalue_t convert8bitsTelemValue(uint8_t channel, ls_telemetry_value_t value)
{
getvalue_t result;
switch (channel) {
@@ -2037,13 +2037,13 @@ getvalue_t convert8bitsTelemValue(uint8_t channel, csw_telemetry_value_t value)
return result;
}
getvalue_t convertCswTelemValue(CustomSwData * cs)
getvalue_t convertCswTelemValue(LogicalSwitchData * cs)
{
getvalue_t val;
#if defined(CPUARM)
val = convert16bitsTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, cs->v2);
#else
if (cswFamily(cs->func)==CS_FAMILY_OFS)
if (cswFamily(cs->func)==LS_FAMILY_OFS)
val = convert8bitsTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, 128+cs->v2);
else
val = convert8bitsTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, 128+cs->v2) - convert8bitsTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, 128);
@@ -4051,8 +4051,8 @@ void doMixerCalculations()
s_cnt_1s += 1;
for (uint8_t i=0; i<NUM_CSW; i++) {
CustomSwData * cs = cswAddress(i);
if (cs->func == CS_TIMER) {
LogicalSwitchData * cs = cswAddress(i);
if (cs->func == LS_FUNC_TIMER) {
int16_t *lastValue = &csLastValue[i];
if (*lastValue == 0 || *lastValue == CS_LAST_VALUE_INIT) {
*lastValue = -cswTimerValue(cs->v1);
@@ -4065,7 +4065,7 @@ void doMixerCalculations()
*lastValue -= 1;
}
}
else if (cs->func == CS_STICKY) {
else if (cs->func == LS_FUNC_STICKY) {
PACK(typedef struct {
bool state;
bool last;
@@ -4092,7 +4092,7 @@ void doMixerCalculations()
}
}
#if defined(CPUARM)
else if (cs->func == CS_STAY) {
else if (cs->func == LS_FUNC_STAY) {
PACK(typedef struct {
uint8_t state:1;
uint16_t duration:15;
+15 -15
View File
@@ -1225,7 +1225,7 @@ ExpoData *expoAddress(uint8_t idx);
MixData *mixAddress(uint8_t idx);
LimitData *limitAddress(uint8_t idx);
int8_t *curveAddress(uint8_t idx);
CustomSwData *cswAddress(uint8_t idx);
LogicalSwitchData *cswAddress(uint8_t idx);
#if !defined(PCBTARANIS)
struct CurveInfo {
@@ -1290,14 +1290,14 @@ extern int24_t act [MAX_MIXERS];
#endif
enum CswFunctionFamilies {
CS_FAMILY_OFS,
CS_FAMILY_BOOL,
CS_FAMILY_COMP,
CS_FAMILY_DIFF,
CS_FAMILY_TIMER,
CS_FAMILY_STICKY,
CS_FAMILY_RANGE,
CS_FAMILY_STAY
LS_FAMILY_OFS,
LS_FAMILY_BOOL,
LS_FAMILY_COMP,
LS_FAMILY_DIFF,
LS_FAMILY_TIMER,
LS_FAMILY_STICKY,
LS_FAMILY_RANGE,
LS_FAMILY_STAY
};
uint8_t cswFamily(uint8_t func);
@@ -1646,20 +1646,20 @@ extern uint8_t barsThresholds[THLD_MAX];
#endif
#if defined(FRSKY)
csw_telemetry_value_t minTelemValue(uint8_t channel);
csw_telemetry_value_t maxTelemValue(uint8_t channel);
ls_telemetry_value_t minTelemValue(uint8_t channel);
ls_telemetry_value_t maxTelemValue(uint8_t channel);
#else
#define minTelemValue(channel) 255
#define maxTelemValue(channel) 255
#endif
#if defined(CPUARM)
getvalue_t convert16bitsTelemValue(uint8_t channel, csw_telemetry_value_t value);
csw_telemetry_value_t max8bitsTelemValue(uint8_t channel);
getvalue_t convert16bitsTelemValue(uint8_t channel, ls_telemetry_value_t value);
ls_telemetry_value_t max8bitsTelemValue(uint8_t channel);
#endif
getvalue_t convert8bitsTelemValue(uint8_t channel, csw_telemetry_value_t value);
getvalue_t convertCswTelemValue(CustomSwData * cs);
getvalue_t convert8bitsTelemValue(uint8_t channel, ls_telemetry_value_t value);
getvalue_t convertCswTelemValue(LogicalSwitchData * cs);
#if defined(CPUARM)
#define convertTelemValue(channel, value) convert16bitsTelemValue(channel, value)
+4 -4
View File
@@ -146,7 +146,7 @@ void setCurve(uint8_t c, const pm_int8_t ar[])
void setSwitch(uint8_t idx, uint8_t func, int8_t v1, int8_t v2)
{
CustomSwData *cs = cswAddress(idx-1);
LogicalSwitchData *cs = cswAddress(idx-1);
cs->func = func;
cs->v1 = v1;
cs->v2 = v2;
@@ -198,8 +198,8 @@ void applyTemplate(uint8_t idx)
md=setDest(13, MIXSRC_CH14); // md->weight= 100; done by setDest anyway
md=setDest(13, MIXSRC_MAX); mixSetWeight(md, -100); md->swtch=SWSRC_SWB; md->mltpx=MLTPX_REP;
md=setDest(13, MIXSRC_MAX); /* md->weight= 100;*/ md->swtch=SWSRC_THR; md->mltpx=MLTPX_REP;
setSwitch(11, CS_VNEG, STK_THR, -99);
setSwitch(12, CS_VPOS, MIXSRC_CH14, 0);
setSwitch(11, LS_FUNC_VNEG, STK_THR, -99);
setSwitch(12, LS_FUNC_VPOS, MIXSRC_CH14, 0);
break;
// V-Tail
@@ -283,7 +283,7 @@ void applyTemplate(uint8_t idx)
// Servo Test
case TMPL_SERVO_TEST:
md=setDest(NUM_CHNOUT-1, MIXSRC_SW1, true); md->weight=110; md->mltpx=MLTPX_ADD; md->delayUp = 6; md->delayDown = 6; md->speedUp = 8; md->speedDown = 8;
setSwitch(1, CS_VNEG, MIXSRC_LAST_CH, 0);
setSwitch(1, LS_FUNC_VNEG, MIXSRC_LAST_CH, 0);
break;
default: