Switches configuration + Switches/Pots/Sliders/Sticks custom names

This commit is contained in:
bsongis
2014-11-21 18:22:13 +01:00
parent 59d72f93ce
commit 06437b2954
14 changed files with 660 additions and 144 deletions
+20
View File
@@ -1401,6 +1401,14 @@ bool isSourceAvailable(int source)
return false;
}
#if defined(PCBTARANIS)
if (source>=MIXSRC_SI && source<=MIXSRC_SN) {
if (!IS_2x2POS(source-MIXSRC_SI)) {
return false;
}
}
#endif
if (source>=MIXSRC_SW1 && source<=MIXSRC_LAST_LOGICAL_SWITCH) {
LogicalSwitchData * cs = lswAddress(source-MIXSRC_SW1);
return (cs->func != LS_FUNC_NONE);
@@ -1487,6 +1495,18 @@ bool isSwitchAvailable(int swtch, SwitchContext context)
swtch = -swtch;
}
#if defined(PCBTARANIS)
if (swtch == SWSRC_SA1 || swtch == SWSRC_SB1 || swtch == SWSRC_SC1 || swtch == SWSRC_SD1 || swtch == SWSRC_SE1 || swtch == SWSRC_SG1) {
return IS_3POS((swtch-SWSRC_SA0)/3);
}
if (swtch >= SWSRC_SI0 && swtch <= SWSRC_SM2) {
return IS_2x2POS((swtch-SWSRC_SI0)/2);
}
if (swtch >= SWSRC_SN0 && swtch <= SWSRC_SN2) {
return IS_2x2POS(6);
}
#endif
#if defined(PCBTARANIS)
if (swtch >= SWSRC_FIRST_MULTIPOS_SWITCH && swtch <= SWSRC_LAST_MULTIPOS_SWITCH) {
int index = (swtch - SWSRC_FIRST_MULTIPOS_SWITCH) / XPOTS_MULTIPOS_COUNT;