From fc716b3a2ae4a6a669e69151834c8d54d40d9550 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 22 Jan 2014 17:31:21 +0100 Subject: [PATCH 1/3] Issue #488. Firmware part done --- radio/src/eeprom_conversions.cpp | 2 +- radio/src/gui/menu_model.cpp | 2 +- radio/src/myeeprom.h | 2 +- radio/src/opentx.cpp | 4 ++-- radio/src/translations/en.h | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/radio/src/eeprom_conversions.cpp b/radio/src/eeprom_conversions.cpp index 0e325d247..24d4bb3a5 100644 --- a/radio/src/eeprom_conversions.cpp +++ b/radio/src/eeprom_conversions.cpp @@ -224,7 +224,7 @@ void ConvertModel_215_to_216(ModelData &model) } g_model.protocol = oldModel.protocol; g_model.thrTrim = oldModel.thrTrim; - g_model.trimInc = oldModel.trimInc; + g_model.trimInc = oldModel.trimInc - 2; g_model.disableThrottleWarning = oldModel.disableThrottleWarning; g_model.extendedLimits = oldModel.extendedLimits; g_model.extendedTrims = oldModel.extendedTrims; diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index d1f9889fb..1fc493ce5 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -1106,7 +1106,7 @@ void menuModelSetup(uint8_t event) break; case ITEM_MODEL_TRIM_INC: - g_model.trimInc = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_TRIMINC, STR_VTRIMINC, g_model.trimInc, 0, 4, attr, event); + g_model.trimInc = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_TRIMINC, STR_VTRIMINC, g_model.trimInc, -2, 2, attr, event); break; case ITEM_MODEL_THROTTLE_REVERSED: diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index bbf184de6..64d168787 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -1424,7 +1424,7 @@ PACK(typedef struct t_ModelData { uint8_t thrTrim:1; // Enable Throttle Trim AVR_FIELD(int8_t ppmNCH:4) ARM_FIELD(int8_t spare2:4) - uint8_t trimInc:3; // Trim Increments + int8_t trimInc:3; // Trim Increments uint8_t disableThrottleWarning:1; ARM_FIELD(uint8_t displayText:1) AVR_FIELD(uint8_t pulsePol:1) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index ee634a7d2..e135f73c1 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2293,12 +2293,12 @@ 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; + int8_t s = g_model.trimInc + 2; // TODO check flash usage, below we do arithmetics again ... #else uint8_t checkTrim(uint8_t event) { int8_t k = EVT_KEY_MASK(event) - TRM_BASE; - int8_t s = g_model.trimInc; + int8_t s = g_model.trimInc + 2; // TODO check flash usage, below we do arithmetics again ... 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 diff --git a/radio/src/translations/en.h b/radio/src/translations/en.h index 62876daf9..175d9769b 100644 --- a/radio/src/translations/en.h +++ b/radio/src/translations/en.h @@ -71,8 +71,8 @@ #define LEN_COUNTRYCODES TR("\002", "\007") #define TR_COUNTRYCODES TR("US""JP""EU", "America""Japan\0 ""Europe\0") -#define LEN_VTRIMINC TR("\006","\013") -#define TR_VTRIMINC TR("Expo ""ExFine""Fine ""Medium""Coarse","Exponential""Extra Fine ""Fine ""Medium ""Coarse ") +#define LEN_VTRIMINC TR("\006", "\013") +#define TR_VTRIMINC TR("Expo\0 ""ExFine""Fine\0 ""Medium""Coarse", "Exponential""Extra Fine\0""Fine\0 ""Medium\0 ""Coarse\0 ") #define LEN_VBEEPCOUNTDOWN "\006" #define TR_VBEEPCOUNTDOWN "SilentBeeps\0Voice\0" From bb0ab5583090b4b18a5cefe95581c1a16708738a Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 22 Jan 2014 17:43:55 +0100 Subject: [PATCH 2/3] Issue #488 : Companion part done. --- companion/src/eeprominterface.h | 2 +- companion/src/firmwares/er9x/er9xeeprom.cpp | 2 +- .../src/firmwares/ersky9x/ersky9xeeprom.cpp | 4 ++-- .../src/firmwares/gruvin9x/gruvin9xeeprom.cpp | 8 ++++---- .../firmwares/opentx/open9xGruvin9xeeprom.cpp | 10 +++++----- .../src/firmwares/opentx/open9xSky9xeeprom.cpp | 10 +++++----- .../src/firmwares/opentx/open9xStockeeprom.cpp | 18 +++++++++--------- .../src/firmwares/opentx/opentxeeprom.cpp | 6 +++++- companion/src/modeledit/setup.cpp | 4 ++-- 9 files changed, 34 insertions(+), 30 deletions(-) diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index 105230592..79f9381ac 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -841,7 +841,7 @@ class ModelData { TimerData timers[2]; bool thrTrim; // Enable Throttle Trim bool thrExpo; // Enable Throttle Expo - unsigned int trimInc; // Trim Increments + int trimInc; // Trim Increments bool disableThrottleWarning; unsigned int beepANACenter; // 1<<0->A1.. 1<<6->A7 diff --git a/companion/src/firmwares/er9x/er9xeeprom.cpp b/companion/src/firmwares/er9x/er9xeeprom.cpp index f07716e72..7d5599b20 100644 --- a/companion/src/firmwares/er9x/er9xeeprom.cpp +++ b/companion/src/firmwares/er9x/er9xeeprom.cpp @@ -388,7 +388,7 @@ t_Er9xModelData::operator ModelData () c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH; c9x.thrTrim = thrTrim; c9x.thrExpo = thrExpo; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.funcSw[0].func = FuncInstantTrim; if (trimSw) { diff --git a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp index 1247c795a..49fcc3c2f 100644 --- a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp +++ b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp @@ -532,7 +532,7 @@ t_Ersky9xModelData_v10::operator ModelData () c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH; c9x.thrTrim = thrTrim; c9x.thrExpo = thrExpo; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.funcSw[0].func = FuncInstantTrim; if (trimSw) { @@ -654,7 +654,7 @@ t_Ersky9xModelData_v11::operator ModelData () c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH; c9x.thrTrim = thrTrim; c9x.thrExpo = thrExpo; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.funcSw[0].func = FuncInstantTrim; if (trimSw) { diff --git a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp index 429899ab5..3296de16f 100644 --- a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp +++ b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp @@ -458,7 +458,7 @@ t_Gruvin9xModelData_v102::operator ModelData () c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; c9x.thrExpo = thrExpo; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -529,7 +529,7 @@ t_Gruvin9xModelData_v103::operator ModelData () c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; c9x.thrExpo = thrExpo; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -600,7 +600,7 @@ t_Gruvin9xModelData_v105::operator ModelData () c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; c9x.thrExpo = thrExpo; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -691,7 +691,7 @@ t_Gruvin9xModelData_v106::operator ModelData () c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; c9x.thrExpo = thrExpo; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; diff --git a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp index d18939827..20bd50453 100644 --- a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp @@ -454,7 +454,7 @@ t_Open9xGruvin9xModelData_v207::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -538,7 +538,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.disableThrottleWarning=disableThrottleWarning; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -627,7 +627,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.disableThrottleWarning=disableThrottleWarning; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -717,7 +717,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.disableThrottleWarning=disableThrottleWarning; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -804,7 +804,7 @@ t_Open9xGruvin9xModelData_v211::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.disableThrottleWarning=disableThrottleWarning; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; diff --git a/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp b/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp index 524d55fee..b9ebaae7a 100644 --- a/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp @@ -760,7 +760,7 @@ t_Open9xArmModelData_v208::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.disableThrottleWarning=disableThrottleWarning; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -849,7 +849,7 @@ t_Open9xArmModelData_v209::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.disableThrottleWarning=disableThrottleWarning; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -939,7 +939,7 @@ t_Open9xArmModelData_v210::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.disableThrottleWarning=disableThrottleWarning; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -1023,7 +1023,7 @@ t_Open9xArmModelData_v211::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.disableThrottleWarning=disableThrottleWarning; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -1110,7 +1110,7 @@ t_Open9xArmModelData_v212::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.disableThrottleWarning=disableThrottleWarning; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; diff --git a/companion/src/firmwares/opentx/open9xStockeeprom.cpp b/companion/src/firmwares/opentx/open9xStockeeprom.cpp index 8529f78f8..9989cf8c5 100644 --- a/companion/src/firmwares/opentx/open9xStockeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xStockeeprom.cpp @@ -950,7 +950,7 @@ t_Open9xModelData_v201::operator ModelData () c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; c9x.thrExpo = thrExpo; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -1024,7 +1024,7 @@ t_Open9xModelData_v202::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter, c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -1100,7 +1100,7 @@ t_Open9xModelData_v203::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -1174,7 +1174,7 @@ t_Open9xModelData_v204::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -1253,7 +1253,7 @@ t_Open9xModelData_v205::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -1339,7 +1339,7 @@ t_Open9xModelData_v208::operator ModelData () c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; c9x.disableThrottleWarning=disableThrottleWarning; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -1432,7 +1432,7 @@ t_Open9xModelData_v209::operator ModelData () c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; c9x.disableThrottleWarning=disableThrottleWarning; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -1526,7 +1526,7 @@ t_Open9xModelData_v210::operator ModelData () c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; c9x.disableThrottleWarning=disableThrottleWarning; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; @@ -1614,7 +1614,7 @@ t_Open9xModelData_v211::operator ModelData () c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; c9x.disableThrottleWarning=disableThrottleWarning; - c9x.trimInc = trimInc; + c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; c9x.moduleData[0].ppmPulsePol = pulsePol; diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 892dcdd01..d663357c5 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -1851,7 +1851,11 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u else internalField.Append(new ConversionField< SignedField<4> >(modelData.moduleData[0].channelsCount, &channelsConversionTable, "Channels number", ::QObject::tr("OpenTX doesn't allow this number of channels"))); - internalField.Append(new UnsignedField<3>(modelData.trimInc)); + if (version >= 216) + internalField.Append(new SignedField<3>(modelData.trimInc)); + else + internalField.Append(new ConversionField< SignedField<3> >(modelData.trimInc, +2)); + internalField.Append(new BoolField<1>(modelData.disableThrottleWarning)); if (IS_TARANIS(board) || (IS_ARM(board) && version >= 216)) diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index b663f577a..753d91ca7 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -476,7 +476,7 @@ void Setup::on_extendedTrims_toggled(bool checked) void Setup::on_trimIncrement_currentIndexChanged(int index) { - model.trimInc = index; + model.trimInc = index-2; emit modified(); } @@ -535,7 +535,7 @@ void Setup::update() ui->throttleWarning->setChecked(model.disableThrottleWarning); //trim inc, thro trim, thro expo, instatrim - ui->trimIncrement->setCurrentIndex(model.trimInc); + ui->trimIncrement->setCurrentIndex(model.trimInc+2); ui->throttleTrim->setChecked(model.thrTrim); ui->extendedLimits->setChecked(model.extendedLimits); ui->extendedTrims->setChecked(model.extendedTrims); From d3b66c849be93b0aba3fda1cae6a42d1e8a984e7 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 23 Jan 2014 16:08:49 +0100 Subject: [PATCH 3/3] [9x stock] Some bytes saved with trims usage --- radio/src/opentx.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index e135f73c1..258c87b58 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2293,12 +2293,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 + 2; // TODO check flash usage, below we do arithmetics again ... #else uint8_t checkTrim(uint8_t event) { int8_t k = EVT_KEY_MASK(event) - TRM_BASE; - int8_t s = g_model.trimInc + 2; // TODO check flash usage, below we do arithmetics again ... 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 @@ -2329,7 +2327,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)