Merge pull request #577 from opentx/bsongis/Issue488_change_default_trim_mode_to_fine

Bsongis/issue488 change default trim mode to fine
This commit is contained in:
Andre Bernet
2014-01-23 10:52:26 -08:00
14 changed files with 41 additions and 38 deletions
+2 -3
View File
@@ -2300,12 +2300,10 @@ void checkTrims()
uint8_t event = getEvent(true);
if (event && !IS_KEY_BREAK(event)) {
int8_t k = EVT_KEY_MASK(event) - TRM_BASE;
int8_t s = g_model.trimInc;
#else
uint8_t checkTrim(uint8_t event)
{
int8_t k = EVT_KEY_MASK(event) - TRM_BASE;
int8_t s = g_model.trimInc;
if (k>=0 && k<8 && !IS_KEY_BREAK(event)) {
#endif
// LH_DWN LH_UP LV_DWN LV_UP RV_DWN RV_UP RH_DWN RH_UP
@@ -2336,7 +2334,8 @@ uint8_t checkTrim(uint8_t event)
before = getRawTrimValue(phase, idx);
thro = (idx==THR_STICK && g_model.thrTrim);
#endif
int8_t v = (s==0) ? min(32, abs(before)/4+1) : 1 << (s-1); // 1=>1 2=>2 3=>4 4=>8
int8_t trimInc = g_model.trimInc + 1;
int8_t v = (trimInc==-1) ? min(32, abs(before)/4+1) : (1 << trimInc);
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)