Skip to content

Commit

Permalink
Always map xlite primary trims to Aileron/Elev (opentx#5852)
Browse files Browse the repository at this point in the history
kilrah authored Apr 28, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b386dd2 commit 69bf7b3
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion radio/src/opentx.cpp
Original file line number Diff line number Diff line change
@@ -1316,7 +1316,7 @@ uint8_t checkTrim(event_t event)
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
uint8_t idx = CONVERT_MODE((uint8_t)k/2);
uint8_t idx = CONVERT_MODE_TRIMS((uint8_t)k/2);
uint8_t phase;
int before;
bool thro;
8 changes: 7 additions & 1 deletion radio/src/opentx.h
Original file line number Diff line number Diff line change
@@ -527,7 +527,13 @@ extern const pm_uint8_t modn12x3[];
#define ELE_STICK 1
#define THR_STICK 2
#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);

2 changes: 1 addition & 1 deletion radio/src/switches.cpp
Original file line number Diff line number Diff line change
@@ -495,7 +495,7 @@ bool getSwitch(swsrc_t swtch)
#endif
else if (cs_idx <= SWSRC_LAST_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);
}
#if ROTARY_ENCODERS > 0

0 comments on commit 69bf7b3

Please sign in to comment.