[MENU long] on a switch in Function Switches screen converts a screen to his correspondant momentary switch (THR <=> THRm, !THR <=> !THRm)

This commit is contained in:
bsongis
2012-08-27 13:27:07 +00:00
parent 77571bd9cd
commit c14da4fdbe
3 changed files with 21 additions and 3 deletions
+17 -1
View File
@@ -120,7 +120,23 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui
#if defined(AUTOSWITCH)
if (s_editMode>0 && (i_flags & INCDEC_SWITCH)) {
int8_t swtch = getMovedSwitch();
if (swtch) newval = swtch;
if (swtch) {
if (newval == DSW_TRN && swtch == DSW_TRN)
newval = -newval;
else
newval = swtch;
}
}
if (event == EVT_KEY_LONG(KEY_MENU) && i_max > SWITCH_ON) {
s_editMode = !s_editMode;
if (newval > SWITCH_ON)
newval -= (MAX_SWITCH+1);
else if (newval > 0)
newval += (MAX_SWITCH+1);
else if (newval < SWITCH_OFF)
newval += (MAX_SWITCH+1);
else if (newval < 0)
newval -= (MAX_SWITCH+1);
}
#endif