1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-20 06:45:10 +03:00

Always map xlite primary trims to Aileron/Elev (#5852)

This commit is contained in:
Andre Bernet 2018-04-28 15:51:29 +02:00 committed by GitHub
parent b386dd23fb
commit 69bf7b3cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View file

@ -1316,7 +1316,7 @@ uint8_t checkTrim(event_t event)
if (k>=0 && k<8 && !IS_KEY_BREAK(event)) { if (k>=0 && k<8 && !IS_KEY_BREAK(event)) {
#endif #endif
// LH_DWN LH_UP LV_DWN LV_UP RV_DWN RV_UP RH_DWN RH_UP // LH_DWN LH_UP LV_DWN LV_UP RV_DWN RV_UP RH_DWN RH_UP
uint8_t idx = CONVERT_MODE((uint8_t)k/2); uint8_t idx = CONVERT_MODE_TRIMS((uint8_t)k/2);
uint8_t phase; uint8_t phase;
int before; int before;
bool thro; bool thro;

View file

@ -527,7 +527,13 @@ extern const pm_uint8_t modn12x3[];
#define ELE_STICK 1 #define ELE_STICK 1
#define THR_STICK 2 #define THR_STICK 2
#define AIL_STICK 3 #define AIL_STICK 3
#define CONVERT_MODE(x) (((x)<=AIL_STICK) ? pgm_read_byte(modn12x3 + 4*g_eeGeneral.stickMode + (x)) : (x) ) #define CONVERT_MODE(x) (((x)<=AIL_STICK) ? pgm_read_byte(modn12x3 + 4*g_eeGeneral.stickMode + (x)) : (x) )
#if defined(PCBXLITE)
#define CONVERT_MODE_TRIMS(x) (((x) == RUD_STICK) ? AIL_STICK : ((x) == AIL_STICK) ? RUD_STICK : (x))
#else
#define CONVERT_MODE_TRIMS(x) CONVERT_MODE(x)
#endif
extern uint8_t channel_order(uint8_t x); extern uint8_t channel_order(uint8_t x);

View file

@ -495,7 +495,7 @@ bool getSwitch(swsrc_t swtch)
#endif #endif
else if (cs_idx <= SWSRC_LAST_TRIM) { else if (cs_idx <= SWSRC_LAST_TRIM) {
uint8_t idx = cs_idx - SWSRC_FIRST_TRIM; uint8_t idx = cs_idx - SWSRC_FIRST_TRIM;
idx = (CONVERT_MODE(idx/2) << 1) + (idx & 1); idx = (CONVERT_MODE_TRIMS(idx/2) << 1) + (idx & 1);
result = trimDown(idx); result = trimDown(idx);
} }
#if ROTARY_ENCODERS > 0 #if ROTARY_ENCODERS > 0