diff --git a/src/open9x.cpp b/src/open9x.cpp index fb6653b83..06fc3804d 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -987,20 +987,25 @@ uint8_t mixWarning; FORCEINLINE void evalTrims(uint8_t phase) { for (uint8_t i=0; i throttle trim if applicable - int16_t v = anas[i]; - int32_t vv = 2*RESX; - int16_t trim = getTrimValue(getTrimFlightPhase(i, phase), i); - if (i==THR_STICK && g_model.thrTrim) { - if (g_eeGeneral.throttleReversed) - trim = -trim; - vv = ((int32_t)trim-TRIM_MIN)*(RESX-v)/(2*RESX); - } - else if (trimsCheckTimer > 0) { - trim = 0; + if (s_noStickInputs && i==THR_STICK) { + trims[i] = 0; } + else { + // do trim -> throttle trim if applicable + int16_t v = anas[i]; + int32_t vv = 2*RESX; + int16_t trim = getTrimValue(getTrimFlightPhase(i, phase), i); + if (i==THR_STICK && g_model.thrTrim) { + if (g_eeGeneral.throttleReversed) + trim = -trim; + vv = ((int32_t)trim-TRIM_MIN)*(RESX-v)/(2*RESX); + } + else if (trimsCheckTimer > 0) { + trim = 0; + } - trims[i] = (vv==2*RESX) ? trim*2 : (int16_t)vv*2; // if throttle trim -> trim low end + trims[i] = (vv==2*RESX) ? trim*2 : (int16_t)vv*2; // if throttle trim -> trim low end + } } } @@ -1020,7 +1025,7 @@ uint8_t evalSticks(uint8_t phase) uint8_t anaCenter = 0; - for(uint8_t i=0; i [-1024..1024] uint8_t ch = (i < NUM_STICKS ? CONVERT_MODE(i+1) - 1 : i); @@ -1042,7 +1047,6 @@ uint8_t evalSticks(uint8_t phase) calibratedStick[ch] = v; //for show in expo if(!(v/16)) anaCenter |= 1<