mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 05:15:18 +03:00
[X9D] P3 fix
This commit is contained in:
parent
63614a06f8
commit
f78dbafa17
7 changed files with 32 additions and 14 deletions
|
@ -632,8 +632,13 @@ 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,
|
||||||
|
|
|
@ -167,11 +167,15 @@ void drawSliders()
|
||||||
{
|
{
|
||||||
for (uint8_t i = NUM_STICKS; i < NUM_STICKS + NUM_POTS + NUM_SLIDERS; i++) {
|
for (uint8_t i = NUM_STICKS; i < NUM_STICKS + NUM_POTS + NUM_SLIDERS; i++) {
|
||||||
#if defined(PCBX9E)
|
#if defined(PCBX9E)
|
||||||
if (i < SLIDER1) continue; // TODO change and display more values
|
if (i < SLIDER1)
|
||||||
|
continue; // TODO change and display more values
|
||||||
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 (i == POT3) continue;
|
#if defined(HARDWARE_POT3)
|
||||||
|
if (i == POT3)
|
||||||
|
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
|
||||||
|
|
|
@ -125,6 +125,7 @@ OpenTxSim::OpenTxSim(FXApp* a):
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
knobs[i]->setRange(-1024, 1024);
|
knobs[i]->setRange(-1024, 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,14 +36,14 @@
|
||||||
9 /*TX_VOLTAGE*/, 10 /*TX_VBAT*/ };
|
9 /*TX_VOLTAGE*/, 10 /*TX_VBAT*/ };
|
||||||
#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)
|
||||||
|
const int8_t adcDirection[NUM_ANALOGS] = {1,-1,1,-1, 1,1, 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)
|
||||||
const int8_t adcDirection[NUM_ANALOGS] = {-1,1,-1,1, 1,1, 1};
|
const int8_t adcDirection[NUM_ANALOGS] = {-1,1,-1,1, 1,1, 1};
|
||||||
#elif defined(PCBXLITE)
|
#elif defined(PCBXLITE)
|
||||||
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};
|
||||||
#else
|
|
||||||
const int8_t adcDirection[NUM_ANALOGS] = {1,-1,1,-1, 1,1,0, 1,1, 1, 1};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if NUM_PWMSTICKS > 0
|
#if NUM_PWMSTICKS > 0
|
||||||
|
|
|
@ -465,6 +465,11 @@ enum Analogs {
|
||||||
SLIDER2,
|
SLIDER2,
|
||||||
SLIDER3,
|
SLIDER3,
|
||||||
SLIDER4,
|
SLIDER4,
|
||||||
|
#elif defined(PCBX9D)
|
||||||
|
POT2,
|
||||||
|
POT_LAST = POT2,
|
||||||
|
SLIDER1,
|
||||||
|
SLIDER2,
|
||||||
#else
|
#else
|
||||||
POT2,
|
POT2,
|
||||||
POT3,
|
POT3,
|
||||||
|
@ -556,7 +561,7 @@ enum CalibratedAnalogs {
|
||||||
CALIBRATED_STICK3,
|
CALIBRATED_STICK3,
|
||||||
CALIBRATED_STICK4,
|
CALIBRATED_STICK4,
|
||||||
CALIBRATED_POT_FIRST,
|
CALIBRATED_POT_FIRST,
|
||||||
CALIBRATED_POT_LAST = CALIBRATED_POT_FIRST + NUM_POTS - 1,
|
CALIBRATED_POT_LAST = CALIBRATED_POT_FIRST + STORAGE_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
|
||||||
|
|
|
@ -50,6 +50,9 @@
|
||||||
#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"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue