A little bit expo (x^2) in repeat frequency

This commit is contained in:
Bertrand Songis
2014-02-18 16:28:25 +01:00
parent 0157eebf7c
commit 8023606223
3 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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;