From 201d7d095e3be24c7b30f9ce557b9c134a7a5f49 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 20 Jul 2012 10:11:13 +0000 Subject: [PATCH] No more momentary switches with Safety Function --- src/model_menus.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/model_menus.cpp b/src/model_menus.cpp index 98a7ac0c8..ea2552cdf 100644 --- a/src/model_menus.cpp +++ b/src/model_menus.cpp @@ -2427,7 +2427,11 @@ void menuProcFunctionSwitches(uint8_t event) uint8_t active = (attr && (s_editMode>0 || p1valdiff)); switch (j) { case 0: - putsSwitches(3, y, sd->swtch, SWONOFF | attr | ((abs(sd->swtch) <= MAX_SWITCH && getSwitch(sd->swtch, 0) && (sd->func >= 16 || (FSW_PARAM(sd) & 1))) ? BOLD : 0)); + if (sd->func <= FUNC_SAFETY_CH16 && (FSW_PARAM(sd) & 1)) { + if (sd->swtch > MAX_SWITCH+1) sd->swtch -= (MAX_SWITCH+1); + if (sd->swtch < -MAX_SWITCH-1) sd->swtch += (MAX_SWITCH+1); + } + putsSwitches(3, y, sd->swtch, SWONOFF | attr | ((abs(sd->swtch) <= (MAX_SWITCH+1) && getSwitch(sd->swtch, 0) && (sd->func >= 16 || (FSW_PARAM(sd) & 1))) ? BOLD : 0)); if (active) { CHECK_INCDEC_MODELSWITCH( event, sd->swtch, SWITCH_OFF-MAX_SWITCH, SWITCH_ON+MAX_SWITCH+1); }