1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 21:05:26 +03:00

[X9D] Different fix

This commit is contained in:
Bertrand Songis 2019-10-07 14:28:00 +02:00
parent f78dbafa17
commit a08c391f93
No known key found for this signature in database
GPG key ID: F189F79290FEC50F
6 changed files with 7 additions and 20 deletions

View file

@ -632,13 +632,8 @@ enum MixSources {
#elif defined(PCBTARANIS) #elif defined(PCBTARANIS)
MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1") MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1")
MIXSRC_POT2, LUA_EXPORT("s2", "Potentiometer 2") MIXSRC_POT2, LUA_EXPORT("s2", "Potentiometer 2")
#if defined(PCBX9D)
MIXSRC_POT3 = MIXSRC_NONE,
MIXSRC_FIRST_SLIDER = MIXSRC_POT2 + 1,
#else
MIXSRC_POT3, LUA_EXPORT("s3", "Potentiometer 3") MIXSRC_POT3, LUA_EXPORT("s3", "Potentiometer 3")
MIXSRC_FIRST_SLIDER, MIXSRC_FIRST_SLIDER,
#endif
MIXSRC_SLIDER1 = MIXSRC_FIRST_SLIDER, LUA_EXPORT("ls", "Left slider") MIXSRC_SLIDER1 = MIXSRC_FIRST_SLIDER, LUA_EXPORT("ls", "Left slider")
MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider") MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider")
MIXSRC_LAST_POT = MIXSRC_SLIDER2, MIXSRC_LAST_POT = MIXSRC_SLIDER2,

View file

@ -172,10 +172,8 @@ void drawSliders()
coord_t x = ((i==SLIDER1 || i==SLIDER3) ? 3 : LCD_W-5); coord_t x = ((i==SLIDER1 || i==SLIDER3) ? 3 : LCD_W-5);
int8_t y = (i<SLIDER3 ? LCD_H/2+1 : 1); int8_t y = (i<SLIDER3 ? LCD_H/2+1 : 1);
#else #else
#if defined(HARDWARE_POT3)
if (i == POT3) if (i == POT3)
continue; continue;
#endif
coord_t x = ((i==POT1 || i==SLIDER1) ? 3 : LCD_W-5); coord_t x = ((i==POT1 || i==SLIDER1) ? 3 : LCD_W-5);
int8_t y = (i>=SLIDER1 ? LCD_H/2+1 : 1); int8_t y = (i>=SLIDER1 ? LCD_H/2+1 : 1);
#endif #endif

View file

@ -99,7 +99,7 @@ enum {
#if defined(HARDWARE_POT2) #if defined(HARDWARE_POT2)
ITEM_RADIO_HARDWARE_POT2, ITEM_RADIO_HARDWARE_POT2,
#endif #endif
#if defined(HARDWARE_POT3) #if defined(HARDWARE_POT3) || defined(PCBX9D) // TODO #if defined(STORAGE_POT3)
ITEM_RADIO_HARDWARE_POT3, ITEM_RADIO_HARDWARE_POT3,
#endif #endif
#if defined(HARDWARE_POT4) #if defined(HARDWARE_POT4)
@ -194,6 +194,8 @@ enum {
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1 #define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
#elif (NUM_POTS + NUM_SLIDERS) == 3 #elif (NUM_POTS + NUM_SLIDERS) == 3
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1 #define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
#elif defined(PCBX9D) // TODO defined(STORAGE_POT3) && !defined(STORAGE_POT3)
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, HIDDEN_ROW, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
#elif (NUM_POTS + NUM_SLIDERS) == 4 #elif (NUM_POTS + NUM_SLIDERS) == 4
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1 #define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
#elif (NUM_POTS + NUM_SLIDERS) == 5 #elif (NUM_POTS + NUM_SLIDERS) == 5
@ -472,7 +474,7 @@ void menuRadioHardware(event_t event)
{ {
int index = k - ITEM_RADIO_HARDWARE_SA; int index = k - ITEM_RADIO_HARDWARE_SA;
int config = SWITCH_CONFIG(index); int config = SWITCH_CONFIG(index);
lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, MIXSRC_FIRST_SWITCH-MIXSRC_Rud+index+1, menuHorizontalPosition < 0 ? attr : 0); lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, MIXSRC_FIRST_SWITCH - MIXSRC_Rud + index + 1, menuHorizontalPosition < 0 ? attr : 0);
if (ZEXIST(g_eeGeneral.switchNames[index]) || (attr && s_editMode > 0 && menuHorizontalPosition == 0)) if (ZEXIST(g_eeGeneral.switchNames[index]) || (attr && s_editMode > 0 && menuHorizontalPosition == 0))
editName(HW_SETTINGS_COLUMN1, y, g_eeGeneral.switchNames[index], LEN_SWITCH_NAME, event, menuHorizontalPosition == 0 ? attr : 0); editName(HW_SETTINGS_COLUMN1, y, g_eeGeneral.switchNames[index], LEN_SWITCH_NAME, event, menuHorizontalPosition == 0 ? attr : 0);
else else

View file

@ -37,7 +37,7 @@
#elif defined(PCBX9DP) #elif defined(PCBX9DP)
const int8_t adcDirection[NUM_ANALOGS] = {1,-1,1,-1, 1,1,-1, 1,1, 1, 1}; const int8_t adcDirection[NUM_ANALOGS] = {1,-1,1,-1, 1,1,-1, 1,1, 1, 1};
#elif defined(PCBX9D) #elif defined(PCBX9D)
const int8_t adcDirection[NUM_ANALOGS] = {1,-1,1,-1, 1,1, 1,1, 1, 1}; const int8_t adcDirection[NUM_ANALOGS] = {1,-1,1,-1, 1,1,0, 1,1, 1, 1};
#elif defined(PCBX7) #elif defined(PCBX7)
const int8_t adcDirection[NUM_ANALOGS] = {-1,1,-1,1, 1,1, 1, 1}; const int8_t adcDirection[NUM_ANALOGS] = {-1,1,-1,1, 1,1, 1, 1};
#elif defined(PCBX9LITE) #elif defined(PCBX9LITE)

View file

@ -465,11 +465,6 @@ enum Analogs {
SLIDER2, SLIDER2,
SLIDER3, SLIDER3,
SLIDER4, SLIDER4,
#elif defined(PCBX9D)
POT2,
POT_LAST = POT2,
SLIDER1,
SLIDER2,
#else #else
POT2, POT2,
POT3, POT3,
@ -503,7 +498,7 @@ enum Analogs {
#define STORAGE_NUM_POTS 3 #define STORAGE_NUM_POTS 3
#define STORAGE_NUM_SLIDERS 2 #define STORAGE_NUM_SLIDERS 2
#else #else
#define NUM_POTS 2 #define NUM_POTS 3 // TODO X9D has only 2 pots
#define NUM_SLIDERS 2 #define NUM_SLIDERS 2
#define STORAGE_NUM_POTS 3 #define STORAGE_NUM_POTS 3
#define STORAGE_NUM_SLIDERS 2 #define STORAGE_NUM_SLIDERS 2
@ -561,7 +556,7 @@ enum CalibratedAnalogs {
CALIBRATED_STICK3, CALIBRATED_STICK3,
CALIBRATED_STICK4, CALIBRATED_STICK4,
CALIBRATED_POT_FIRST, CALIBRATED_POT_FIRST,
CALIBRATED_POT_LAST = CALIBRATED_POT_FIRST + STORAGE_NUM_POTS - 1, CALIBRATED_POT_LAST = CALIBRATED_POT_FIRST + NUM_POTS - 1,
CALIBRATED_SLIDER_FIRST, CALIBRATED_SLIDER_FIRST,
CALIBRATED_SLIDER_LAST = CALIBRATED_SLIDER_FIRST + NUM_SLIDERS - 1, CALIBRATED_SLIDER_LAST = CALIBRATED_SLIDER_FIRST + NUM_SLIDERS - 1,
NUM_CALIBRATED_ANALOGS NUM_CALIBRATED_ANALOGS

View file

@ -50,9 +50,6 @@
#elif defined(PCBX9LITE) #elif defined(PCBX9LITE)
#define TR_POTS_VSRCRAW "\310S1\0" #define TR_POTS_VSRCRAW "\310S1\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0" #define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0"
#elif defined(PCBX9D)
#define TR_POTS_VSRCRAW "\310S1\0""\310S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0"
#elif defined(PCBTARANIS) #elif defined(PCBTARANIS)
#define TR_POTS_VSRCRAW "\310S1\0""\310S2\0""\310S3\0""\311LS\0""\311RS\0" #define TR_POTS_VSRCRAW "\310S1\0""\310S2\0""\310S3\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0" #define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0"