Issue #192 - Trims and Rotary encoders buttons added to the switches

list
This commit is contained in:
Bertrand Songis
2014-02-06 12:45:53 +01:00
parent 46fe25fd24
commit 4a20329b2b
14 changed files with 178 additions and 108 deletions
+1 -1
View File
@@ -4483,7 +4483,7 @@ void menuModelCustomSwitches(uint8_t event)
v1_min = SWSRC_OFF+1; v1_max = SWSRC_ON-1;
v2_min = SWSRC_OFF+1; v2_max = SWSRC_ON-1;
INCDEC_SET_FLAG(INCDEC_SWITCH);
INCDEC_ENABLE_CHECK(NULL);
INCDEC_ENABLE_CHECK(isSwitchAvailableInCustomSwitches);
}
else if (cstate == CS_VCOMP) {
putsMixerSource(CSW_2ND_COLUMN, y, cs->v1, attr1);
+12 -1
View File
@@ -1260,7 +1260,7 @@ bool isInputSourceAvailable(int16_t source)
return false;
}
bool isSwitchAvailable(int16_t swtch)
bool isSwitchAvailableInCustomSwitches(int16_t swtch)
{
if (swtch < 0) {
if (swtch <= -SWSRC_ON)
@@ -1286,6 +1286,15 @@ bool isSwitchAvailable(int16_t swtch)
}
#endif
return true;
}
bool isSwitchAvailable(int16_t swtch)
{
if (!isSwitchAvailableInCustomSwitches(swtch)) {
return false;
}
if (swtch >= SWSRC_FIRST_CSW && swtch <= SWSRC_LAST_CSW) {
CustomSwData * cs = cswAddress(swtch-SWSRC_FIRST_CSW);
return (cs->func != CS_OFF);
@@ -1293,4 +1302,6 @@ bool isSwitchAvailable(int16_t swtch)
return true;
}
#endif
+1
View File
@@ -191,6 +191,7 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
#if defined(CPUARM)
bool isSwitchAvailable(int16_t swtch);
bool isSwitchAvailableInCustomSwitches(int16_t swtch);
#define AUTOSWITCH_ENTER_LONG() (attr && event==EVT_KEY_LONG(KEY_ENTER))
#define CHECK_INCDEC_MODELSWITCH(event, var, min, max) \
var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SWITCH|NO_INCDEC_MARKS, isSwitchAvailable)