diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index e135f73c1..258c87b58 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2293,12 +2293,10 @@ void checkTrims() uint8_t event = getEvent(true); if (event && !IS_KEY_BREAK(event)) { int8_t k = EVT_KEY_MASK(event) - TRM_BASE; - int8_t s = g_model.trimInc + 2; // TODO check flash usage, below we do arithmetics again ... #else uint8_t checkTrim(uint8_t event) { int8_t k = EVT_KEY_MASK(event) - TRM_BASE; - int8_t s = g_model.trimInc + 2; // TODO check flash usage, below we do arithmetics again ... if (k>=0 && k<8 && !IS_KEY_BREAK(event)) { #endif // LH_DWN LH_UP LV_DWN LV_UP RV_DWN RV_UP RH_DWN RH_UP @@ -2329,7 +2327,8 @@ uint8_t checkTrim(uint8_t event) before = getRawTrimValue(phase, idx); thro = (idx==THR_STICK && g_model.thrTrim); #endif - int8_t v = (s==0) ? min(32, abs(before)/4+1) : 1 << (s-1); // 1=>1 2=>2 3=>4 4=>8 + int8_t trimInc = g_model.trimInc + 1; + int8_t v = (trimInc==-1) ? min(32, abs(before)/4+1) : (1 << trimInc); if (thro) v = 4; // if throttle trim and trim trottle then step=4 int16_t after = (k&1) ? before + v : before - v; // positive = k&1 #if defined(CPUARM)