Merge pull request #6909 from opentx/bsongis/x9d_p3_fix
Bsongis/x9d p3 fix
This commit is contained in:
@@ -167,11 +167,13 @@ 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 (i == POT3)
|
||||||
|
continue;
|
||||||
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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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,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)
|
||||||
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
|
||||||
|
|||||||
@@ -498,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
|
||||||
|
|||||||
Reference in New Issue
Block a user