mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 08:15:17 +03:00
In case it is useful, comments appreciated!
This commit is contained in:
parent
afa8a7991e
commit
1d1f4ed4fe
4 changed files with 14 additions and 15 deletions
|
@ -2737,9 +2737,8 @@ void insertExpoMix(uint8_t expo, uint8_t idx)
|
|||
#if defined(PCBTARANIS)
|
||||
expo->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channel_order(s_currCh));
|
||||
expo->curve.type = CURVE_REF_EXPO;
|
||||
#else
|
||||
expo->mode = 3; // pos&neg
|
||||
#endif
|
||||
expo->mode = 3; // pos&neg
|
||||
expo->chn = s_currCh - 1;
|
||||
expo->weight = 100;
|
||||
}
|
||||
|
@ -2880,7 +2879,7 @@ enum ExposFields {
|
|||
IF_CURVES(EXPO_FIELD_CURVE)
|
||||
IF_FLIGHT_MODES(EXPO_FIELD_FLIGHT_PHASE)
|
||||
EXPO_FIELD_SWITCH,
|
||||
CASE_9X(EXPO_FIELD_SIDE)
|
||||
EXPO_FIELD_SIDE,
|
||||
CASE_PCBTARANIS(EXPO_FIELD_TRIM)
|
||||
EXPO_FIELD_MAX
|
||||
};
|
||||
|
@ -3014,11 +3013,9 @@ void menuModelExpoOne(uint8_t event)
|
|||
ed->swtch = switchMenuItem(EXPO_ONE_2ND_COLUMN-IF_9X(3*FW), y, ed->swtch, attr, event);
|
||||
break;
|
||||
|
||||
#if !defined(PCBTARANIS)
|
||||
case EXPO_FIELD_SIDE:
|
||||
ed->mode = 4 - selectMenuItem(EXPO_ONE_2ND_COLUMN-3*FW, y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, attr, event);
|
||||
ed->mode = 4 - selectMenuItem(EXPO_ONE_2ND_COLUMN-IF_9X(3*FW), y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, attr, event);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
case EXPO_FIELD_TRIM:
|
||||
|
@ -3286,8 +3283,9 @@ static uint8_t s_copySrcCh;
|
|||
#define EXPO_LINE_SRC_POS 9*FW-2
|
||||
#define EXPO_LINE_CURVE_POS 12*FW+4
|
||||
#define EXPO_LINE_SWITCH_POS 17*FW-1
|
||||
#define EXPO_LINE_SIDE_POS 20*FW-1
|
||||
#define EXPO_LINE_SELECT_POS 5*FW+2
|
||||
#define EXPO_LINE_FM_POS LCD_W-LEN_EXPOMIX_NAME*FW-MENUS_SCROLLBAR_WIDTH-FW-1
|
||||
#define EXPO_LINE_FM_POS LCD_W-LEN_EXPOMIX_NAME*FW-MENUS_SCROLLBAR_WIDTH-FW
|
||||
#define EXPO_LINE_NAME_POS LCD_W-LEN_EXPOMIX_NAME*FW-MENUS_SCROLLBAR_WIDTH
|
||||
#define MIX_LINE_WEIGHT_POS 11*FW+5
|
||||
#define MIX_LINE_CURVE_POS 12*FW+4
|
||||
|
@ -3578,9 +3576,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
|||
|
||||
putsSwitches(EXPO_LINE_SWITCH_POS, y, ed->swtch, 0);
|
||||
|
||||
#if !defined(PCBTARANIS)
|
||||
if (ed->mode!=3) lcd_putc(EXPO_LINE_SIDE_POS, y, ed->mode == 2 ? 126 : 127);
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM) && LCD_W >= 212
|
||||
displayFlightModes(EXPO_LINE_FM_POS, y, ed->phases);
|
||||
|
|
|
@ -446,15 +446,16 @@ PACK(typedef struct t_ExpoData {
|
|||
int8_t swtch;
|
||||
uint16_t phases;
|
||||
int8_t weight;
|
||||
int8_t carryTrim;
|
||||
int8_t carryTrim:6;
|
||||
uint8_t mode:2;
|
||||
char name[LEN_EXPOMIX_NAME];
|
||||
int8_t offset;
|
||||
CurveRef curve;
|
||||
uint8_t spare;
|
||||
}) ExpoData;
|
||||
#define MIN_EXPO_WEIGHT -100
|
||||
#define EXPO_VALID(ed) ((ed)->srcRaw)
|
||||
#define EXPO_MODE_ENABLE(ed, v) (true)
|
||||
#define EXPO_VALID(ed) ((ed)->mode)
|
||||
#define EXPO_MODE_ENABLE(ed, v) (((v)<0 && ((ed)->mode&1)) || ((v)>=0 && ((ed)->mode&2)))
|
||||
#elif defined(CPUARM)
|
||||
PACK(typedef struct t_ExpoData {
|
||||
uint8_t mode; // 0=end, 1=pos, 2=neg, 3=both
|
||||
|
@ -468,7 +469,7 @@ PACK(typedef struct t_ExpoData {
|
|||
}) ExpoData;
|
||||
#define MIN_EXPO_WEIGHT 0
|
||||
#define EXPO_VALID(ed) ((ed)->mode)
|
||||
#define EXPO_MODE_ENABLE(ed, v) ((v<0 && (ed->mode&1)) || (v>=0 && (ed->mode&2)))
|
||||
#define EXPO_MODE_ENABLE(ed, v) (((v)<0 && ((ed)->mode&1)) || ((v)>=0 && ((ed)->mode&2)))
|
||||
#elif defined(CPUM2560) || defined(CPUM2561)
|
||||
PACK(typedef struct t_ExpoData {
|
||||
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
|
||||
|
@ -482,7 +483,7 @@ PACK(typedef struct t_ExpoData {
|
|||
}) ExpoData;
|
||||
#define MIN_EXPO_WEIGHT 0
|
||||
#define EXPO_VALID(ed) ((ed)->mode)
|
||||
#define EXPO_MODE_ENABLE(ed, v) ((v<0 && (ed->mode&1)) || (v>=0 && (ed->mode&2)))
|
||||
#define EXPO_MODE_ENABLE(ed, v) (((v)<0 && ((ed)->mode&1)) || ((v)>=0 && ((ed)->mode&2)))
|
||||
#else
|
||||
PACK(typedef struct t_ExpoData {
|
||||
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
|
||||
|
@ -495,7 +496,7 @@ PACK(typedef struct t_ExpoData {
|
|||
}) ExpoData;
|
||||
#define MIN_EXPO_WEIGHT 0
|
||||
#define EXPO_VALID(ed) ((ed)->mode)
|
||||
#define EXPO_MODE_ENABLE(ed, v) ((v<0 && (ed->mode&1)) || (v>=0 && (ed->mode&2)))
|
||||
#define EXPO_MODE_ENABLE(ed, v) (((v)<0 && ((ed)->mode&1)) || ((v)>=0 && ((ed)->mode&2)))
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
|
|
|
@ -540,6 +540,7 @@ void applyDefaultTemplate()
|
|||
expo->curve.type = CURVE_REF_EXPO;
|
||||
expo->chn = i;
|
||||
expo->weight = 100;
|
||||
expo->mode = 3; // TODO constant
|
||||
for (int c=0; c<4; c++) {
|
||||
g_model.inputNames[i][c] = char2idx(STR_VSRCRAW[1+STR_VSRCRAW[0]*stick_index+c]);
|
||||
}
|
||||
|
|
|
@ -113,6 +113,7 @@ void defaultInputs()
|
|||
expo->curve.type = CURVE_REF_EXPO;
|
||||
expo->chn = i;
|
||||
expo->weight = 100;
|
||||
expo->mode = 3; // TODO constant
|
||||
for (int c=0; c<4; c++) {
|
||||
g_model.inputNames[i][c] = char2idx(STR_VSRCRAW[1+STR_VSRCRAW[0]*stick_index+c]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue