This commit is contained in:
Damjan Adamic
2014-07-31 15:08:37 +02:00
parent 1b2efd1121
commit 21ae270c0e
2 changed files with 5 additions and 7 deletions
+4 -2
View File
@@ -753,9 +753,11 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms)
if (mix_trim == THR_STICK) {
if (g_model.thrTrim) {
if (g_model.throttleReversed) {
trim = -trim;
trim = ((int32_t)(trim+TRIM_MIN) * (RESX-v)) >> (RESX_SHIFT+1);
}
else {
trim = ((int32_t)(trim-TRIM_MIN) * (RESX-v)) >> (RESX_SHIFT+1);
}
trim = ((trim-2*TRIM_MIN) * (RESX-v)) >> (RESX_SHIFT+1);
}
if (g_model.throttleReversed) {
trim = -trim;
+1 -5
View File
@@ -1661,11 +1661,7 @@ 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;
trim = (((g_model.throttleReversed)?(int32_t)(trim+TRIM_MIN):(int32_t)(trim-TRIM_MIN)) * (RESX-getValue(MIXSRC_Thr))) >> (RESX_SHIFT+1);
}
#endif
if (trimsCheckTimer > 0) {