Fixes #2434
This commit is contained in:
+16
-6
@@ -444,18 +444,28 @@ bool getSwitch(int8_t swtch)
|
|||||||
}
|
}
|
||||||
else if (cs_idx <= SWSRC_LAST_SWITCH) {
|
else if (cs_idx <= SWSRC_LAST_SWITCH) {
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
if ((flags & GETSWITCH_MIDPOS_DELAY) && IS_3POS(cs_idx))
|
if (flags & GETSWITCH_MIDPOS_DELAY) {
|
||||||
result = SWITCH_POSITION(cs_idx-SWSRC_FIRST_SWITCH);
|
div_t swinfo = switchInfo(cs_idx);
|
||||||
else
|
if (IS_3POS(swinfo.quot)) {
|
||||||
#endif
|
result = SWITCH_POSITION(cs_idx-SWSRC_FIRST_SWITCH);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result = switchState((EnumKeys)(SW_BASE+cs_idx-SWSRC_FIRST_SWITCH));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result = switchState((EnumKeys)(SW_BASE+cs_idx-SWSRC_FIRST_SWITCH));
|
||||||
|
}
|
||||||
|
#else
|
||||||
result = switchState((EnumKeys)(SW_BASE+cs_idx-SWSRC_FIRST_SWITCH));
|
result = switchState((EnumKeys)(SW_BASE+cs_idx-SWSRC_FIRST_SWITCH));
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
||||||
if (startupWarningState < STARTUP_WARNING_DONE) {
|
if (startupWarningState < STARTUP_WARNING_DONE) {
|
||||||
// if throttle or switch warning is currently active, ignore actual stick position and use wanted values
|
// if throttle or switch warning is currently active, ignore actual stick position and use wanted values
|
||||||
if (cs_idx <= 3) {
|
if (cs_idx <= 3) {
|
||||||
if (!(g_model.switchWarningEnable&1)) { // ID1 to ID3 is just one bit in switchWarningEnable
|
if (!(g_model.switchWarningEnable & 1)) { // ID1 to ID3 is just one bit in switchWarningEnable
|
||||||
result = (cs_idx)==((g_model.switchWarningState&3)+1); // overwrite result with desired value
|
result = (cs_idx)==((g_model.switchWarningState & 3)+1); // overwrite result with desired value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!(g_model.switchWarningEnable & (1<<(cs_idx-3)))) {
|
else if (!(g_model.switchWarningEnable & (1<<(cs_idx-3)))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user