[X3] More fixes
This commit is contained in:
@@ -50,7 +50,7 @@ void menuRadioDiagKeys(event_t event)
|
||||
}
|
||||
|
||||
if (i < TRM_BASE) {
|
||||
#if defined(PCBX7)
|
||||
#if defined(PCBX7) || defined(PCBX3)
|
||||
y = MENU_HEADER_HEIGHT + FH + FH*i;
|
||||
if (i >= 2) {
|
||||
// hide PLUS and MINUS virtual buttons
|
||||
|
||||
@@ -103,7 +103,9 @@ enum MenuRadioHardwareItems {
|
||||
ITEM_RADIO_HARDWARE_STICK4,
|
||||
ITEM_RADIO_HARDWARE_LABEL_POTS,
|
||||
ITEM_RADIO_HARDWARE_POT1,
|
||||
#if !defined(PCBX3)
|
||||
ITEM_RADIO_HARDWARE_POT2,
|
||||
#endif
|
||||
ITEM_RADIO_HARDWARE_LABEL_SWITCHES,
|
||||
ITEM_RADIO_HARDWARE_SA,
|
||||
ITEM_RADIO_HARDWARE_SB,
|
||||
@@ -111,6 +113,8 @@ enum MenuRadioHardwareItems {
|
||||
ITEM_RADIO_HARDWARE_SD,
|
||||
#if NUM_SWITCHES > 4
|
||||
ITEM_RADIO_HARDWARE_SF,
|
||||
#endif
|
||||
#if NUM_SWITCHES > 5
|
||||
ITEM_RADIO_HARDWARE_SH,
|
||||
#endif
|
||||
#if defined(CROSSFIRE) && SPORT_MAX_BAUDRATE < 400000
|
||||
@@ -128,11 +132,17 @@ enum MenuRadioHardwareItems {
|
||||
ITEM_RADIO_HARDWARE_MAX
|
||||
};
|
||||
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
|
||||
#if NUM_SWITCHES > 4
|
||||
#define SWITCHES_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#if defined(PCBX3)
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1
|
||||
#else
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#endif
|
||||
|
||||
#if NUM_SWITCHES == 6
|
||||
#define SWITCHES_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#elif NUM_SWITCHES == 5
|
||||
#define SWITCHES_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#elif NUM_SWITCHES == 4
|
||||
#define SWITCHES_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#endif
|
||||
|
||||
@@ -206,7 +216,9 @@ void menuRadioHardware(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_RADIO_HARDWARE_POT1:
|
||||
#if !defined(PCBX3)
|
||||
case ITEM_RADIO_HARDWARE_POT2:
|
||||
#endif
|
||||
{
|
||||
int idx = k - ITEM_RADIO_HARDWARE_POT1;
|
||||
uint8_t shift = (2*idx);
|
||||
@@ -233,6 +245,8 @@ void menuRadioHardware(event_t event)
|
||||
case ITEM_RADIO_HARDWARE_SD:
|
||||
#if NUM_SWITCHES > 4
|
||||
case ITEM_RADIO_HARDWARE_SF:
|
||||
#endif
|
||||
#if NUM_SWITCHES > 5
|
||||
case ITEM_RADIO_HARDWARE_SH:
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -243,17 +243,21 @@ void generalDefault()
|
||||
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
|
||||
#elif defined(PCBX3)
|
||||
g_eeGeneral.potsConfig = 0x01; // S1 = pot without detent
|
||||
#elif defined(PCBTARANIS)
|
||||
g_eeGeneral.potsConfig = 0x05; // S1 and S2 = pots with detent
|
||||
g_eeGeneral.slidersConfig = 0x03; // LS and RS = sliders with detent
|
||||
#endif
|
||||
|
||||
#if defined(PCBXLITES)
|
||||
g_eeGeneral.switchConfig = (SWITCH_TOGGLE << 10) + (SWITCH_TOGGLE << 8) + (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0); // 2x3POS, 2x2POS
|
||||
g_eeGeneral.switchConfig = (SWITCH_TOGGLE << 10) + (SWITCH_TOGGLE << 8) + (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#elif defined(PCBXLITE)
|
||||
g_eeGeneral.switchConfig = (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0); // 2x3POS, 2x2POS
|
||||
g_eeGeneral.switchConfig = (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#elif defined(PCBX7)
|
||||
g_eeGeneral.switchConfig = 0x000006ff; // 4x3POS, 1x2POS, 1xTOGGLE
|
||||
#elif defined(PCBX3)
|
||||
g_eeGeneral.switchConfig = (SWITCH_TOGGLE << 8) + (SWITCH_2POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#elif defined(PCBTARANIS) || defined(PCBHORUS)
|
||||
g_eeGeneral.switchConfig = 0x00007bff; // 6x3POS, 1x2POS, 1xTOGGLE
|
||||
#endif
|
||||
|
||||
@@ -150,22 +150,22 @@
|
||||
#define TRIMS_GPIO_REG_RHR GPIOE->IDR
|
||||
#define TRIMS_GPIO_PIN_RHR GPIO_Pin_4 // PE.04
|
||||
#elif defined(PCBX3)
|
||||
#define TRIMS_GPIO_REG_LHL GPIOC->IDR
|
||||
#define TRIMS_GPIO_PIN_LHL GPIO_Pin_4 // PC.04
|
||||
#define TRIMS_GPIO_REG_LHR GPIOC->IDR
|
||||
#define TRIMS_GPIO_PIN_LHR GPIO_Pin_5 // PC.05
|
||||
#define TRIMS_GPIO_REG_LVD GPIOB->IDR
|
||||
#define TRIMS_GPIO_PIN_LVD GPIO_Pin_0 // PB.00
|
||||
#define TRIMS_GPIO_PIN_LHR GPIO_Pin_4 // PC.04
|
||||
#define TRIMS_GPIO_REG_LHL GPIOC->IDR
|
||||
#define TRIMS_GPIO_PIN_LHL GPIO_Pin_5 // PC.05
|
||||
#define TRIMS_GPIO_REG_LVU GPIOB->IDR
|
||||
#define TRIMS_GPIO_PIN_LVU GPIO_Pin_1 // PB.01
|
||||
#define TRIMS_GPIO_REG_RVD GPIOE->IDR
|
||||
#define TRIMS_GPIO_PIN_RVD GPIO_Pin_13 // PE.13
|
||||
#define TRIMS_GPIO_REG_RHL GPIOE->IDR
|
||||
#define TRIMS_GPIO_PIN_RHL GPIO_Pin_14 // PE.14
|
||||
#define TRIMS_GPIO_REG_RVU GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_RVU GPIO_Pin_8 // PD.08
|
||||
#define TRIMS_GPIO_REG_RHR GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_RHR GPIO_Pin_9 // PD.09
|
||||
#define TRIMS_GPIO_PIN_LVU GPIO_Pin_0 // PB.00
|
||||
#define TRIMS_GPIO_REG_LVD GPIOB->IDR
|
||||
#define TRIMS_GPIO_PIN_LVD GPIO_Pin_1 // PB.01
|
||||
#define TRIMS_GPIO_REG_RVU GPIOE->IDR
|
||||
#define TRIMS_GPIO_PIN_RVU GPIO_Pin_13 // PE.13
|
||||
#define TRIMS_GPIO_REG_RVD GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_RVD GPIO_Pin_8 // PD.08
|
||||
#define TRIMS_GPIO_REG_RHR GPIOE->IDR
|
||||
#define TRIMS_GPIO_PIN_RHR GPIO_Pin_14 // PE.14
|
||||
#define TRIMS_GPIO_REG_RHL GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_RHL GPIO_Pin_9 // PD.09
|
||||
#else
|
||||
#define TRIMS_GPIO_REG_LHL GPIOE->IDR
|
||||
#define TRIMS_GPIO_PIN_LHL GPIO_Pin_4 // PE.04
|
||||
|
||||
Reference in New Issue
Block a user