From 4e6571812623f6e9dd2c996f17adfa537e2b7eb5 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 2 Apr 2014 12:00:41 +0200 Subject: [PATCH] Issue #909 fixed --- radio/src/opentx.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index ae54e4f4e..46d81cb8f 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1467,7 +1467,9 @@ bool getSwitch(int8_t swtch) } #endif else if (cs_idx <= SWSRC_LAST_TRIM) { - result = trimDown(cs_idx-SWSRC_FIRST_TRIM); + uint8_t idx = cs_idx - SWSRC_FIRST_TRIM; + idx = (CONVERT_MODE(idx/2) << 1) + (idx & 1); + result = trimDown(idx); } #if ROTARY_ENCODERS > 0 else if (cs_idx == SWSRC_REa) {