mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 12:25:12 +03:00
[X3] fixes
This commit is contained in:
parent
c563c6c1f2
commit
794a63778e
4 changed files with 23 additions and 13 deletions
|
@ -499,7 +499,17 @@ void menuMainView(event_t event)
|
|||
doMainScreenGraphics();
|
||||
|
||||
// Switches
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBX3)
|
||||
static const uint8_t x[NUM_SWITCHES] = {2*FW-2, 2*FW-2, 16*FW+1, 2*FW-2, 16*FW+1};
|
||||
static const uint8_t y[NUM_SWITCHES] = {4*FH+1, 5*FH+1, 5*FH+1, 6*FH+1, 6*FH+1};
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH + i);
|
||||
getvalue_t sw = ((val < 0) ? 3 * i + 1 : ((val == 0) ? 3 * i + 2 : 3 * i + 3));
|
||||
drawSwitch(x[i], y[i], sw, 0);
|
||||
}
|
||||
}
|
||||
#elif defined(PCBTARANIS)
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
uint8_t x = 2*FW-2, y = 4*FH+i*FH+1;
|
||||
|
|
|
@ -242,9 +242,9 @@ void generalDefault()
|
|||
#elif defined(PCBXLITE)
|
||||
g_eeGeneral.potsConfig = 0x0F; // S1 and S2 = pot without detent
|
||||
#elif defined(PCBX7)
|
||||
g_eeGeneral.potsConfig = 0x07; // S1 = pot without detent, S2 = pot with detent
|
||||
g_eeGeneral.potsConfig = (POT_WITHOUT_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#elif defined(PCBX3)
|
||||
g_eeGeneral.potsConfig = 0x01; // S1 = pot without detent
|
||||
g_eeGeneral.potsConfig = (POT_WITH_DETENT << 0); // S1 = pot with detent
|
||||
#elif defined(PCBTARANIS)
|
||||
g_eeGeneral.potsConfig = 0x05; // S1 and S2 = pots with detent
|
||||
g_eeGeneral.slidersConfig = 0x03; // LS and RS = sliders with detent
|
||||
|
|
|
@ -38,12 +38,12 @@
|
|||
const int8_t ana_direction[NUM_ANALOGS] = {1,-1,1,-1, 1,1,-1, 1,1, 1};
|
||||
#elif defined(PCBX7)
|
||||
const int8_t ana_direction[NUM_ANALOGS] = {-1,1,-1,1, 1,1, 1};
|
||||
#elif defined(PCBX3)
|
||||
const int8_t ana_direction[NUM_ANALOGS] = {-1,1,-1,1, 1,1};
|
||||
#elif defined(PCBXLITE)
|
||||
const int8_t ana_direction[NUM_ANALOGS] = {1,-1,-1,1, -1,1, 1};
|
||||
#elif defined(REV4a)
|
||||
const int8_t ana_direction[NUM_ANALOGS] = {1,-1,1,-1, 1,-1,0, 1,1, 1};
|
||||
#else
|
||||
const int8_t ana_direction[NUM_ANALOGS] = {1,-1,-1,1, 1,1};
|
||||
#endif
|
||||
|
||||
#if NUM_PWMSTICKS > 0
|
||||
|
|
|
@ -574,14 +574,14 @@
|
|||
#define ADC_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_DMA2)
|
||||
#define ADC_RCC_APB1Periph 0
|
||||
#define ADC_RCC_APB2Periph RCC_APB2Periph_ADC1
|
||||
#define ADC_GPIO_PIN_STICK_RV GPIO_Pin_0 // PA.00
|
||||
#define ADC_GPIO_PIN_STICK_RH GPIO_Pin_1 // PA.01
|
||||
#define ADC_GPIO_PIN_STICK_LV GPIO_Pin_2 // PA.02
|
||||
#define ADC_GPIO_PIN_STICK_LH GPIO_Pin_3 // PA.03
|
||||
#define ADC_CHANNEL_STICK_RV ADC_Channel_0 // ADC1_IN0
|
||||
#define ADC_CHANNEL_STICK_RH ADC_Channel_1 // ADC1_IN1
|
||||
#define ADC_CHANNEL_STICK_LV ADC_Channel_2 // ADC1_IN2
|
||||
#define ADC_CHANNEL_STICK_LH ADC_Channel_3 // ADC1_IN3
|
||||
#define ADC_GPIO_PIN_STICK_LH GPIO_Pin_0 // PA.00
|
||||
#define ADC_GPIO_PIN_STICK_LV GPIO_Pin_1 // PA.01
|
||||
#define ADC_GPIO_PIN_STICK_RV GPIO_Pin_2 // PA.02
|
||||
#define ADC_GPIO_PIN_STICK_RH GPIO_Pin_3 // PA.03
|
||||
#define ADC_CHANNEL_STICK_LH ADC_Channel_0 // ADC1_IN0
|
||||
#define ADC_CHANNEL_STICK_LV ADC_Channel_1 // ADC1_IN1
|
||||
#define ADC_CHANNEL_STICK_RV ADC_Channel_2 // ADC1_IN2
|
||||
#define ADC_CHANNEL_STICK_RH ADC_Channel_3 // ADC1_IN3
|
||||
#define ADC_GPIO_PIN_POT1 GPIO_Pin_1 // PC.01
|
||||
#define ADC_GPIO_PIN_BATT GPIO_Pin_0 // PC.00
|
||||
#define ADC_GPIOA_PINS (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue