Issue #592 - AND switch bug on 9x stock
This commit is contained in:
@@ -4550,8 +4550,16 @@ void menuModelCustomSwitches(uint8_t event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSW and switch
|
// CSW AND switch
|
||||||
|
#if defined(CPUARM)
|
||||||
putsSwitches(CSW_4TH_COLUMN, y, cs->andsw, horz==3 ? attr : 0);
|
putsSwitches(CSW_4TH_COLUMN, y, cs->andsw, horz==3 ? 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==3 ? attr : 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
// CSW duration
|
// CSW duration
|
||||||
|
|||||||
@@ -1414,7 +1414,14 @@ bool getSwitch(int8_t swtch)
|
|||||||
s_last_switch_used |= mask;
|
s_last_switch_used |= mask;
|
||||||
|
|
||||||
CustomSwData * cs = cswAddress(cs_idx);
|
CustomSwData * cs = cswAddress(cs_idx);
|
||||||
|
#if defined(CPUARM)
|
||||||
|
int8_t s = cs->andsw;
|
||||||
|
#else
|
||||||
uint8_t s = cs->andsw;
|
uint8_t s = cs->andsw;
|
||||||
|
if (s > SWSRC_LAST_SWITCH) {
|
||||||
|
s += SWSRC_SW1-SWSRC_LAST_SWITCH-1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (cs->func == CS_OFF || (s && !getSwitch(s))) {
|
if (cs->func == CS_OFF || (s && !getSwitch(s))) {
|
||||||
csLastValue[cs_idx] = CS_LAST_VALUE_INIT;
|
csLastValue[cs_idx] = CS_LAST_VALUE_INIT;
|
||||||
result = false;
|
result = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user