Merge pull request #1576 from opentx/projectkk2glider/dirty_hack_issue_1569
Projectkk2glider/dirty hack issue 1569
This commit is contained in:
+2
-4
@@ -752,10 +752,8 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms)
|
||||
int32_t trim = trims[mix_trim];
|
||||
if (mix_trim == THR_STICK) {
|
||||
if (g_model.thrTrim) {
|
||||
if (g_model.throttleReversed) {
|
||||
trim = -trim;
|
||||
}
|
||||
trim = ((trim-2*TRIM_MIN) * (RESX-v)) >> (RESX_SHIFT+1);
|
||||
int16_t trimMin = g_model.extendedTrims ? 2*TRIM_EXTENDED_MIN : 2*TRIM_MIN;
|
||||
trim = (((g_model.throttleReversed)?(trim+trimMin):(trim-trimMin)) * (RESX-v)) >> (RESX_SHIFT+1);
|
||||
}
|
||||
if (g_model.throttleReversed) {
|
||||
trim = -trim;
|
||||
|
||||
@@ -1661,11 +1661,8 @@ FORCEINLINE void evalTrims()
|
||||
int16_t trim = getTrimValue(phase, i);
|
||||
#if !defined(PCBTARANIS)
|
||||
if (i==THR_STICK && g_model.thrTrim) {
|
||||
if (g_model.throttleReversed)
|
||||
trim = -trim;
|
||||
int16_t v = anas[i];
|
||||
int32_t vv = ((int32_t)trim-TRIM_MIN)*(RESX-v)>>(RESX_SHIFT+1);
|
||||
trim = vv;
|
||||
int16_t trimMin = g_model.extendedTrims ? TRIM_EXTENDED_MIN : TRIM_MIN;
|
||||
trim = (((g_model.throttleReversed)?(int32_t)(trim+trimMin):(int32_t)(trim-trimMin)) * (RESX-anas[i])) >> (RESX_SHIFT+1);
|
||||
}
|
||||
#endif
|
||||
if (trimsCheckTimer > 0) {
|
||||
|
||||
Reference in New Issue
Block a user