1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 01:35:21 +03:00

[X7D/SKY9X] Logical switches screen bugs

This commit is contained in:
Bertrand Songis 2016-11-29 19:34:58 +01:00
parent 9ab415dadb
commit 6cd031d2cc
3 changed files with 18 additions and 6 deletions

View file

@ -572,15 +572,19 @@ enum SwitchSources {
SWSRC_SD0,
SWSRC_SD1,
SWSRC_SD2,
#if !defined(PCBX7D)
SWSRC_SE0,
SWSRC_SE1,
SWSRC_SE2,
#endif
SWSRC_SF0,
SWSRC_SF1,
SWSRC_SF2,
#if !defined(PCBX7D)
SWSRC_SG0,
SWSRC_SG1,
SWSRC_SG2,
#endif
SWSRC_SH0,
SWSRC_SH1,
SWSRC_SH2,

View file

@ -63,10 +63,13 @@ void menuModelLogicalSwitchOne(event_t event)
TITLE(STR_MENULOGICALSWITCH);
LogicalSwitchData * cs = lswAddress(s_currIdx);
uint8_t sw = SWSRC_SW1+s_currIdx;
uint8_t cstate = lswFamily(cs->func);
drawSwitch(14*FW, 0, sw, (getSwitch(sw) ? BOLD : 0));
SUBMENU_NOTITLE(LS_FIELD_COUNT, { 0, 0, 1, 0 /*, 0...*/ });
SUBMENU_NOTITLE(LS_FIELD_COUNT, { 0, 0, uint8_t(cstate == LS_FAMILY_EDGE ? 1 : 0), 0 /*, 0...*/ });
int8_t sub = menuVerticalPosition;
@ -78,7 +81,6 @@ void menuModelLogicalSwitchOne(event_t event)
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
uint8_t i = k + menuVerticalOffset;
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
uint8_t cstate = lswFamily(cs->func);
switch (i) {
case LS_FIELD_FUNCTION:
@ -108,6 +110,8 @@ void menuModelLogicalSwitchOne(event_t event)
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY || cstate == LS_FAMILY_EDGE) {
drawSwitch(CSWONE_2ND_COLUMN, y, v1_val, attr);
v1_min = SWSRC_OFF+1; v1_max = SWSRC_ON-1;
INCDEC_SET_FLAG(EE_MODEL | INCDEC_SWITCH);
INCDEC_ENABLE_CHECK(isSwitchAvailableInLogicalSwitches);
}
else if (cstate == LS_FAMILY_TIMER) {
lcdDrawNumber(CSWONE_2ND_COLUMN, y, lswTimerValue(cs->v1), LEFT|PREC1|attr);
@ -133,6 +137,8 @@ void menuModelLogicalSwitchOne(event_t event)
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
drawSwitch(CSWONE_2ND_COLUMN, y, cs->v2, attr);
v2_min = SWSRC_OFF+1; v2_max = SWSRC_ON-1;
INCDEC_SET_FLAG(EE_MODEL | INCDEC_SWITCH);
INCDEC_ENABLE_CHECK(isSwitchAvailableInLogicalSwitches);
}
else if (cstate == LS_FAMILY_TIMER) {
lcdDrawNumber(CSWONE_2ND_COLUMN, y, lswTimerValue(cs->v2), LEFT|PREC1|attr);
@ -183,7 +189,7 @@ void menuModelLogicalSwitchOne(event_t event)
}
if (attr) {
CHECK_INCDEC_MODELVAR(event, cs->v2, v2_min, v2_max);
cs->v2 = CHECK_INCDEC_PARAM(event, cs->v2, v2_min, v2_max);
}
break;
}
@ -191,7 +197,7 @@ void menuModelLogicalSwitchOne(event_t event)
case LS_FIELD_ANDSW:
lcdDrawTextAlignedLeft(y, STR_AND_SWITCH);
drawSwitch(CSWONE_2ND_COLUMN, y, cs->andsw, attr);
if (attr) CHECK_INCDEC_MODELVAR(event, cs->andsw, -MAX_LS_ANDSW, MAX_LS_ANDSW);
if (attr) CHECK_INCDEC_MODELVAR_CHECK(event, cs->andsw, -MAX_LS_ANDSW, MAX_LS_ANDSW, isSwitchAvailableInLogicalSwitches);
break;
case LS_FIELD_DURATION:

View file

@ -251,7 +251,9 @@ void generalDefault()
g_eeGeneral.slidersConfig = 0x03; // LS and RS = sliders with detent
#endif
#if defined(PCBTARANIS) || defined(PCBHORUS)
#if defined(PCBX7D)
g_eeGeneral.switchConfig = 0x000006ff; // 4x3POS, 1x2POS, 1xTOGGLE
#elif defined(PCBTARANIS) || defined(PCBHORUS)
g_eeGeneral.switchConfig = 0x00007bff; // 6x3POS, 1x2POS, 1xTOGGLE
#endif