Cosmetics
This commit is contained in:
+12
-11
@@ -81,6 +81,9 @@ uint64_t switchesPos = 0;
|
|||||||
tmr10ms_t potsLastposStart[NUM_XPOTS];
|
tmr10ms_t potsLastposStart[NUM_XPOTS];
|
||||||
uint8_t potsPos[NUM_XPOTS];
|
uint8_t potsPos[NUM_XPOTS];
|
||||||
|
|
||||||
|
#define SWITCH_POSITION(sw) (switchesPos & ((MASK_CFN_TYPE)1<<(sw)))
|
||||||
|
#define POT_POSITION(sw) ((potsPos[(sw)/XPOTS_MULTIPOS_COUNT] & 0x0f) == ((sw) % XPOTS_MULTIPOS_COUNT))
|
||||||
|
|
||||||
div_t switchInfo(int switchPosition)
|
div_t switchInfo(int switchPosition)
|
||||||
{
|
{
|
||||||
return div(switchPosition-SWSRC_FIRST_SWITCH, 3);
|
return div(switchPosition-SWSRC_FIRST_SWITCH, 3);
|
||||||
@@ -120,17 +123,18 @@ uint64_t check3PosSwitchPosition(uint8_t idx, EnumKeys sw, bool startup)
|
|||||||
result = ((MASK_CFN_TYPE)1 << index);
|
result = ((MASK_CFN_TYPE)1 << index);
|
||||||
switchesMidposStart[idx] = 0;
|
switchesMidposStart[idx] = 0;
|
||||||
}
|
}
|
||||||
else if (startup || (switchesPos & ((MASK_CFN_TYPE)1 << (sw - SW_SA0 + 1))) || g_eeGeneral.switchesDelay==SWITCHES_DELAY_NONE || (switchesMidposStart[idx] && (tmr10ms_t)(get_tmr10ms() - switchesMidposStart[idx]) > SWITCHES_DELAY())) {
|
|
||||||
index = sw - SW_SA0 + 1;
|
|
||||||
result = ((MASK_CFN_TYPE)1 << index);
|
|
||||||
switchesMidposStart[idx] = 0;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
index = sw - SW_SA0 + 1;
|
index = sw - SW_SA0 + 1;
|
||||||
if (!switchesMidposStart[idx]) {
|
if (startup || SWITCH_POSITION(index) || g_eeGeneral.switchesDelay==SWITCHES_DELAY_NONE || (switchesMidposStart[idx] && (tmr10ms_t)(get_tmr10ms() - switchesMidposStart[idx]) > SWITCHES_DELAY())) {
|
||||||
switchesMidposStart[idx] = get_tmr10ms();
|
result = ((MASK_CFN_TYPE)1 << index);
|
||||||
|
switchesMidposStart[idx] = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result = (switchesPos & ((MASK_CFN_TYPE)0x7 << (sw - SW_SA0)));
|
||||||
|
if (!switchesMidposStart[idx]) {
|
||||||
|
switchesMidposStart[idx] = get_tmr10ms();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
result = (switchesPos & ((MASK_CFN_TYPE)0x7 << (sw - SW_SA0)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(switchesPos & result)) {
|
if (!(switchesPos & result)) {
|
||||||
@@ -193,9 +197,6 @@ void getSwitchesPosition(bool startup)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SWITCH_POSITION(sw) (switchesPos & ((MASK_CFN_TYPE)1<<(sw)))
|
|
||||||
#define POT_POSITION(sw) ((potsPos[(sw)/XPOTS_MULTIPOS_COUNT] & 0x0f) == ((sw) % XPOTS_MULTIPOS_COUNT))
|
|
||||||
|
|
||||||
getvalue_t getValueForLogicalSwitch(mixsrc_t i)
|
getvalue_t getValueForLogicalSwitch(mixsrc_t i)
|
||||||
{
|
{
|
||||||
getvalue_t result = getValue(i);
|
getvalue_t result = getValue(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user