diff --git a/radio/src/maths.cpp b/radio/src/maths.cpp index ea049823d..727814ded 100644 --- a/radio/src/maths.cpp +++ b/radio/src/maths.cpp @@ -163,8 +163,7 @@ void varioWakeup() int varioBeepFreq, varioBeepTime; if (verticalSpeed > varioCenterMin) { varioBeepFreq = VARIO_FREQUENCY_ZERO + (g_eeGeneral.varioPitch*10) + (((VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10)) * verticalSpeed) / varioMax); - int period = VARIO_REPEAT_ZERO + (g_eeGeneral.varioRepeat*10); - period -= ((period-VARIO_REPEAT_MAX) * verticalSpeed) / varioMax; + int period = VARIO_REPEAT_MAX + ((VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10)-VARIO_REPEAT_MAX) * verticalSpeed * verticalSpeed) / (varioMax * varioMax); if (verticalSpeed >= varioCenterMax || varioCenterMin == varioCenterMax) varioBeepTime = period / 4; else diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 33c2d82dd..1ddbbf449 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2538,7 +2538,7 @@ uint8_t checkTrim(uint8_t event) thro = (idx==THR_STICK && g_model.thrTrim); #endif int8_t trimInc = g_model.trimInc + 1; - int8_t v = (trimInc==-1) ? min(32, abs(before)/4+1) : (1 << trimInc); + int8_t v = (trimInc==-1) ? min(32, abs(before)/4+1) : (1 << trimInc); // TODO flash saving if (trimInc < 0) 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) diff --git a/radio/src/opentx.h b/radio/src/opentx.h index b3bd33125..3800abe29 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -1334,7 +1334,7 @@ enum FunctionsActive { #define VARIO_FREQUENCY_ZERO 700/*Hz*/ #define VARIO_FREQUENCY_RANGE 1000/*Hz*/ #define VARIO_REPEAT_ZERO 500/*ms*/ -#define VARIO_REPEAT_MAX 50/*ms*/ +#define VARIO_REPEAT_MAX 80/*ms*/ extern MASK_FUNC_TYPE activeFunctions; extern MASK_CFN_TYPE activeFnSwitches;