This commit is contained in:
bsongis
2015-07-08 00:19:29 +02:00
parent be24ff122b
commit 9b7e913fbf
+13 -3
View File
@@ -444,11 +444,21 @@ 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) {
div_t swinfo = switchInfo(cs_idx);
if (IS_3POS(swinfo.quot)) {
result = SWITCH_POSITION(cs_idx-SWSRC_FIRST_SWITCH); result = SWITCH_POSITION(cs_idx-SWSRC_FIRST_SWITCH);
else }
#endif else {
result = switchState((EnumKeys)(SW_BASE+cs_idx-SWSRC_FIRST_SWITCH)); 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));
#endif
#if defined(MODULE_ALWAYS_SEND_PULSES) #if defined(MODULE_ALWAYS_SEND_PULSES)
if (startupWarningState < STARTUP_WARNING_DONE) { if (startupWarningState < STARTUP_WARNING_DONE) {