rename x3 to x9lite
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
@@ -38,7 +38,7 @@
|
||||
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)
|
||||
#elif defined(PCBX9LITE)
|
||||
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};
|
||||
@@ -119,7 +119,7 @@ void adcInit()
|
||||
// TODO why do we invert POT1 and POT2 here?
|
||||
ADC_MAIN->SQR2 = (ADC_CHANNEL_BATT<<0) + (ADC_CHANNEL_RTC<<5); // conversions 7 and more
|
||||
ADC_MAIN->SQR3 = (ADC_CHANNEL_STICK_LH<<0) + (ADC_CHANNEL_STICK_LV<<5) + (ADC_CHANNEL_STICK_RV<<10) + (ADC_CHANNEL_STICK_RH<<15) + (ADC_CHANNEL_POT1<<25) + (ADC_CHANNEL_POT2<<20); // conversions 1 to 6
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
ADC_MAIN->SQR2 = (ADC_CHANNEL_RTC<<0); // conversions 7 and more
|
||||
ADC_MAIN->SQR3 = (ADC_CHANNEL_STICK_LH<<0) + (ADC_CHANNEL_STICK_LV<<5) + (ADC_CHANNEL_STICK_RV<<10) + (ADC_CHANNEL_STICK_RH<<15) + (ADC_CHANNEL_POT1<<20) + (ADC_CHANNEL_BATT<<25); // conversions 1 to 6
|
||||
#else
|
||||
@@ -241,7 +241,7 @@ uint16_t getAnalogValue(uint8_t index)
|
||||
{
|
||||
if (IS_POT(index) && !IS_POT_SLIDER_AVAILABLE(index)) {
|
||||
// Use fixed analog value for non-existing and/or non-connected pots.
|
||||
// Non-connected analog inputs will slightly follow the adjacent connected analog inputs,
|
||||
// Non-connected analog inputs will slightly follow the adjacent connected analog inputs,
|
||||
// which produces ghost readings on these inputs.
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ set(BOOTLOADER_SRC
|
||||
bin_files.cpp
|
||||
)
|
||||
|
||||
if(PCB STREQUAL X12S OR PCB STREQUAL X10 OR PCB STREQUAL X9E OR PCB STREQUAL X7 OR PCB STREQUAL X3)
|
||||
if(PCB STREQUAL X12S OR PCB STREQUAL X10 OR PCB STREQUAL X9E OR PCB STREQUAL X7 OR PCB STREQUAL X9LITE)
|
||||
set(BOOTLOADER_SRC
|
||||
${BOOTLOADER_SRC}
|
||||
../../../../../targets/common/arm/stm32/rotary_encoder_driver.cpp
|
||||
|
||||
@@ -614,8 +614,8 @@ class OpenTxSimulatorFactory: public SimulatorFactory
|
||||
return Board::BOARD_X10;
|
||||
#elif defined(PCBX7)
|
||||
return Board::BOARD_TARANIS_X7;
|
||||
#elif defined(PCBX3)
|
||||
return Board::BOARD_TARANIS_X3;
|
||||
#elif defined(PCBX9LITE)
|
||||
return Board::BOARD_TARANIS_X9LITE;
|
||||
#elif defined(PCBTARANIS)
|
||||
return Board::BOARD_TARANIS_X9D;
|
||||
#else
|
||||
|
||||
@@ -277,7 +277,7 @@ void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
#elif defined(PCBXLITES)
|
||||
SWITCH_CASE (4, SWITCHES_GPIO_REG_E, SWITCHES_GPIO_PIN_E)
|
||||
SWITCH_CASE (5, SWITCHES_GPIO_REG_F, SWITCHES_GPIO_PIN_F)
|
||||
#elif !defined(PCBXLITE) && !defined(PCBX3)
|
||||
#elif !defined(PCBXLITE) && !defined(PCBX9LITE)
|
||||
SWITCH_3_CASE(4, SWITCHES_GPIO_REG_E_L, SWITCHES_GPIO_REG_E_H, SWITCHES_GPIO_PIN_E_L, SWITCHES_GPIO_PIN_E_H)
|
||||
SWITCH_CASE (5, SWITCHES_GPIO_REG_F, SWITCHES_GPIO_PIN_F)
|
||||
SWITCH_3_CASE(6, SWITCHES_GPIO_REG_G_L, SWITCHES_GPIO_REG_G_H, SWITCHES_GPIO_PIN_G_L, SWITCHES_GPIO_PIN_G_H)
|
||||
|
||||
@@ -85,17 +85,17 @@ elseif(PCB STREQUAL X7)
|
||||
set(LCD_DRIVER lcd_driver_spi.cpp)
|
||||
set(GVAR_SCREEN model_gvars.cpp)
|
||||
set(STATUS_LEDS YES)
|
||||
elseif(PCB STREQUAL X3)
|
||||
elseif(PCB STREQUAL X9LITE)
|
||||
set(PXX_FREQUENCY "HIGH")
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_x3)
|
||||
set(FLAVOUR x3)
|
||||
set(LUA_EXPORT lua_export_x9lite)
|
||||
set(FLAVOUR x9lite)
|
||||
add_definitions(-DBOARD_NAME="x9lite")
|
||||
add_definitions(-DPCBX3 -DPCBX9 -DSOFTWARE_VOLUME)
|
||||
add_definitions(-DPCBX9LITE -DPCBX9 -DSOFTWARE_VOLUME)
|
||||
add_definitions(-DEEPROM_VARIANT=0x0800)
|
||||
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||
set(GUI_DIR 128x64)
|
||||
@@ -157,7 +157,7 @@ if(PCB STREQUAL XLITES)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PCB STREQUAL XLITE OR PCB STREQUAL XLITES OR PCB STREQUAL X3)
|
||||
if(PCB STREQUAL XLITE OR PCB STREQUAL XLITES OR PCB STREQUAL X9LITE)
|
||||
add_definitions(-DINTERNAL_MODULE_SERIAL)
|
||||
if(PXX_FREQUENCY STREQUAL HIGH)
|
||||
add_definitions(-DPXX_FREQUENCY_HIGH)
|
||||
@@ -184,7 +184,7 @@ if(NOT PCB STREQUAL XLITE)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PCB STREQUAL X9E OR PCB STREQUAL X7 OR PCB STREQUAL X3)
|
||||
if(PCB STREQUAL X9E OR PCB STREQUAL X7 OR PCB STREQUAL X9LITE)
|
||||
set(TARGET_SRC
|
||||
${TARGET_SRC}
|
||||
../common/arm/stm32/rotary_encoder_driver.cpp
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
@@ -97,7 +97,7 @@ uint8_t isBacklightEnabled()
|
||||
{
|
||||
return (BACKLIGHT_TIMER->CCR4 != 0 || BACKLIGHT_TIMER->CCR2 != 0);
|
||||
}
|
||||
#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBX3)
|
||||
#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
void backlightInit()
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
@@ -218,7 +218,7 @@ void extmoduleSendNextFrame();
|
||||
#define SLAVE_MODE() (g_model.trainerData.mode == TRAINER_MODE_SLAVE)
|
||||
#if defined(PCBX9E)
|
||||
#define TRAINER_CONNECTED() (true)
|
||||
#elif defined(PCBX7) || defined(PCBX3)
|
||||
#elif defined(PCBX7) || defined(PCBX9LITE)
|
||||
#define TRAINER_CONNECTED() (GPIO_ReadInputDataBit(TRAINER_DETECT_GPIO, TRAINER_DETECT_GPIO_PIN) == Bit_SET)
|
||||
#elif defined(PCBXLITES)
|
||||
enum JackState
|
||||
@@ -342,7 +342,7 @@ enum EnumSwitchesPositions
|
||||
SW_SC0,
|
||||
SW_SC1,
|
||||
SW_SC2,
|
||||
#if !defined(PCBX3)
|
||||
#if !defined(PCBX9LITE)
|
||||
SW_SD0,
|
||||
SW_SD1,
|
||||
SW_SD2,
|
||||
@@ -407,7 +407,7 @@ enum EnumSwitchesPositions
|
||||
#define NUM_SWITCHES 4
|
||||
#elif defined(PCBX7)
|
||||
#define NUM_SWITCHES 6
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define NUM_SWITCHES 5
|
||||
#elif defined(PCBX9E)
|
||||
#define NUM_SWITCHES 18 // yes, it's a lot!
|
||||
@@ -422,7 +422,7 @@ uint32_t readTrims(void);
|
||||
#define TRIMS_PRESSED() (readTrims())
|
||||
#define KEYS_PRESSED() (readKeys())
|
||||
|
||||
#if defined(PCBX9E) || defined(PCBX7) || defined(PCBX3)
|
||||
#if defined(PCBX9E) || defined(PCBX7) || defined(PCBX9LITE)
|
||||
// Rotary Encoder driver
|
||||
#define ROTARY_ENCODER_NAVIGATION
|
||||
void rotaryEncoderInit(void);
|
||||
@@ -452,7 +452,7 @@ enum Analogs {
|
||||
STICK4,
|
||||
POT_FIRST,
|
||||
POT1 = POT_FIRST,
|
||||
#if defined(PCBX3)
|
||||
#if defined(PCBX9LITE)
|
||||
POT_LAST = POT1,
|
||||
#elif defined(PCBXLITE) || defined(PCBX7)
|
||||
POT2,
|
||||
@@ -513,7 +513,7 @@ extern HardwareOptions hardwareOptions;
|
||||
#if !defined(PXX2)
|
||||
#define IS_PXX2_INTERNAL_ENABLED() (false)
|
||||
#define IS_PXX1_INTERNAL_ENABLED() (true)
|
||||
#elif !defined(PXX1) || defined(PCBXLITES) || defined(PCBX3)
|
||||
#elif !defined(PXX1) || defined(PCBXLITES) || defined(PCBX9LITE)
|
||||
#define IS_PXX2_INTERNAL_ENABLED() (true)
|
||||
#define IS_PXX1_INTERNAL_ENABLED() (false)
|
||||
#else
|
||||
@@ -571,7 +571,7 @@ uint16_t getBatteryVoltage(); // returns current battery voltage in 10mV steps
|
||||
#define BATT_SCALE 131
|
||||
#elif defined(PCBX7)
|
||||
#define BATT_SCALE 123
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define BATT_SCALE 117
|
||||
#else
|
||||
#define BATT_SCALE 150
|
||||
@@ -646,7 +646,7 @@ uint8_t telemetryGetByte(uint8_t * byte);
|
||||
extern uint32_t telemetryErrors;
|
||||
|
||||
// PCBREV driver
|
||||
#if defined(PCBXLITE) || defined(PCBX3)
|
||||
#if defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define HAS_SPORT_UPDATE_CONNECTOR() true
|
||||
#elif defined(PCBX7)
|
||||
#define IS_PCBREV_40() (GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN) == Bit_SET)
|
||||
@@ -742,7 +742,7 @@ void bluetoothInit(uint32_t baudrate, bool enable);
|
||||
void bluetoothWriteWakeup(void);
|
||||
uint8_t bluetoothIsWriting(void);
|
||||
void bluetoothDisable(void);
|
||||
#if defined(PCBX3)
|
||||
#if defined(PCBX9LITE)
|
||||
#define IS_BLUETOOTH_CHIP_PRESENT() (false)
|
||||
#elif (defined(PCBX7) || defined(PCBXLITE)) && !defined(SIMU)
|
||||
extern volatile uint8_t btChipPresent;
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#define KEYS_GPIO_PIN_EXIT GPIO_Pin_2 // PD.02
|
||||
#define KEYS_GPIO_REG_ENTER GPIOE->IDR
|
||||
#define KEYS_GPIO_PIN_ENTER GPIO_Pin_10 // PE.10
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define KEYS_GPIO_REG_PAGE GPIOE->IDR
|
||||
#define KEYS_GPIO_PIN_PAGE GPIO_Pin_8 // PE.08
|
||||
#define KEYS_GPIO_REG_MENU GPIOE->IDR
|
||||
@@ -106,7 +106,7 @@
|
||||
#define ROTARY_ENCODER_EXTI_PortSource EXTI_PortSourceGPIOE
|
||||
#define ROTARY_ENCODER_EXTI_PinSource1 EXTI_PinSource9
|
||||
#define ROTARY_ENCODER_EXTI_PinSource2 EXTI_PinSource11
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define ROTARY_ENCODER_GPIO GPIOE
|
||||
#define ROTARY_ENCODER_GPIO_PIN_A GPIO_Pin_10 // PE.10
|
||||
#define ROTARY_ENCODER_GPIO_PIN_B GPIO_Pin_12 // PE.12
|
||||
@@ -121,7 +121,7 @@
|
||||
#endif
|
||||
|
||||
// This is for SIMU: reuse rotary encoder pins to map UP and DOWN keyboard keys
|
||||
#if defined(SIMU) && (defined(PCBX9E) || defined(PCBX7) || defined(PCBX3))
|
||||
#if defined(SIMU) && (defined(PCBX9E) || defined(PCBX7) || defined(PCBX9LITE))
|
||||
#define KEYS_GPIO_REG_PLUS ROTARY_ENCODER_GPIO->IDR
|
||||
#define KEYS_GPIO_PIN_PLUS ROTARY_ENCODER_GPIO_PIN_A
|
||||
#define KEYS_GPIO_REG_MINUS ROTARY_ENCODER_GPIO->IDR
|
||||
@@ -172,7 +172,7 @@
|
||||
#define TRIMS_GPIO_PIN_RVU GPIO_Pin_2 // PC.02
|
||||
#define TRIMS_GPIO_REG_RHR GPIOE->IDR
|
||||
#define TRIMS_GPIO_PIN_RHR GPIO_Pin_4 // PE.04
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define TRIMS_GPIO_REG_LHR GPIOC->IDR
|
||||
#define TRIMS_GPIO_PIN_LHR GPIO_Pin_4 // PC.04
|
||||
#define TRIMS_GPIO_REG_LHL GPIOC->IDR
|
||||
@@ -214,7 +214,7 @@
|
||||
#define SWITCHES_GPIO_PIN_A_H GPIO_Pin_10 // PD.10
|
||||
#define SWITCHES_GPIO_REG_A_L GPIOD->IDR
|
||||
#define SWITCHES_GPIO_PIN_A_L GPIO_Pin_14 // PD.14
|
||||
#elif defined(PCBXLITE) || defined(PCBX3)
|
||||
#elif defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define SWITCHES_GPIO_REG_A_H GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_A_H GPIO_Pin_1 // PE.01
|
||||
#define SWITCHES_GPIO_REG_A_L GPIOE->IDR
|
||||
@@ -246,7 +246,7 @@
|
||||
#define SWITCHES_GPIO_PIN_B_L GPIO_Pin_15 // PE.15
|
||||
#define SWITCHES_GPIO_REG_B_H GPIOA->IDR
|
||||
#define SWITCHES_GPIO_PIN_B_H GPIO_Pin_5 // PA.05
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define SWITCHES_GPIO_REG_B_L GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_B_L GPIO_Pin_4 // PB.04
|
||||
#define SWITCHES_GPIO_REG_B_H GPIOB->IDR
|
||||
@@ -263,7 +263,7 @@
|
||||
#define SWITCHES_GPIO_PIN_C_H GPIO_Pin_13 // PF.13
|
||||
#define SWITCHES_GPIO_REG_C_L GPIOF->IDR
|
||||
#define SWITCHES_GPIO_PIN_C_L GPIO_Pin_14 // PF.14
|
||||
#elif defined(PCBXLITE) || defined(PCBX3)
|
||||
#elif defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define SWITCHES_GPIO_REG_C_L GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_C_L GPIO_Pin_2 // PE.02
|
||||
#define SWITCHES_GPIO_REG_C_H GPIOE->IDR
|
||||
@@ -300,7 +300,7 @@
|
||||
#define SWITCHES_GPIO_PIN_D_L GPIO_Pin_1 // PE.01
|
||||
#define SWITCHES_GPIO_REG_D_H GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_D_H GPIO_Pin_2 // PE.02
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
// no SWD
|
||||
#else
|
||||
#define SWITCHES_GPIO_REG_D_H GPIOE->IDR
|
||||
@@ -317,7 +317,7 @@
|
||||
#elif defined(PCBXLITES)
|
||||
#define SWITCHES_GPIO_REG_E GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_E GPIO_Pin_5 // PE.05
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define SWITCHES_GPIO_REG_E GPIOC->IDR
|
||||
#define SWITCHES_GPIO_PIN_E GPIO_Pin_13 // PC.13
|
||||
#elif defined(PCBX7) || defined(PCBXLITE)
|
||||
@@ -340,7 +340,7 @@
|
||||
#elif defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_F GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_F GPIO_Pin_14 // PE.14
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define SWITCHES_GPIO_REG_F GPIOA->IDR
|
||||
#define SWITCHES_GPIO_PIN_F GPIO_Pin_5 // PA.05
|
||||
#else
|
||||
@@ -353,7 +353,7 @@
|
||||
#define SWITCHES_GPIO_PIN_G_H GPIO_Pin_3 // PF.03
|
||||
#define SWITCHES_GPIO_REG_G_L GPIOF->IDR
|
||||
#define SWITCHES_GPIO_PIN_G_L GPIO_Pin_4 // PF.04
|
||||
#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBX3)
|
||||
#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
// no SWG
|
||||
#else
|
||||
#define SWITCHES_GPIO_REG_G_H GPIOE->IDR
|
||||
@@ -368,7 +368,7 @@
|
||||
#elif defined(PCBX9DP)
|
||||
#define SWITCHES_GPIO_REG_H GPIOD->IDR
|
||||
#define SWITCHES_GPIO_PIN_H GPIO_Pin_14 // PD.14
|
||||
#elif defined(PCBXLITE) || defined(PCBX3)
|
||||
#elif defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
// no SWH
|
||||
#elif defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_H GPIOD->IDR
|
||||
@@ -455,7 +455,7 @@
|
||||
#define KEYS_GPIOC_PINS (TRIMS_GPIO_PIN_LHR | TRIMS_GPIO_PIN_RVD | TRIMS_GPIO_PIN_RVU)
|
||||
#define KEYS_GPIOD_PINS (TRIMS_GPIO_PIN_LHL | KEYS_GPIO_PIN_MENU | KEYS_GPIO_PIN_EXIT | KEYS_GPIO_PIN_PAGE | SWITCHES_GPIO_PIN_C_L | SWITCHES_GPIO_PIN_H)
|
||||
#define KEYS_GPIOE_PINS (ROTARY_ENCODER_GPIO_PIN_A | ROTARY_ENCODER_GPIO_PIN_B | KEYS_GPIO_PIN_ENTER | TRIMS_GPIO_PIN_RHR | TRIMS_GPIO_PIN_RHL | TRIMS_GPIO_PIN_LVD | TRIMS_GPIO_PIN_LVU | SWITCHES_GPIO_PIN_C_H | SWITCHES_GPIO_PIN_D_L | SWITCHES_GPIO_PIN_D_H | SWITCHES_GPIO_PIN_B_L | SWITCHES_GPIO_PIN_A_L | SWITCHES_GPIO_PIN_A_H | SWITCHES_GPIO_PIN_F)
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define KEYS_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE)
|
||||
#define KEYS_GPIOA_PINS (GPIO_Pin_5)
|
||||
#define KEYS_GPIOB_PINS (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5)
|
||||
@@ -594,7 +594,7 @@
|
||||
#define ADC_CHANNEL_POT1 ADC_Channel_6
|
||||
#define ADC_CHANNEL_POT2 ADC_Channel_8
|
||||
#define ADC_CHANNEL_BATT ADC_Channel_10
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#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
|
||||
@@ -643,7 +643,7 @@
|
||||
// PWR and LED driver
|
||||
#define PWR_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE)
|
||||
|
||||
#if defined(PCBX3)
|
||||
#if defined(PCBX9LITE)
|
||||
#define PWR_SWITCH_GPIO GPIOA
|
||||
#define PWR_SWITCH_GPIO_PIN GPIO_Pin_7 // PA.07
|
||||
#define PWR_ON_GPIO GPIOA
|
||||
@@ -680,7 +680,7 @@
|
||||
#define LED_RED_GPIO_PIN GPIO_Pin_5 // PC.05
|
||||
#define LED_BLUE_GPIO GPIOB
|
||||
#define LED_BLUE_GPIO_PIN GPIO_Pin_1 // PB.01
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define STATUS_LEDS
|
||||
#define GPIO_LED_GPIO_ON GPIO_SetBits
|
||||
#define GPIO_LED_GPIO_OFF GPIO_ResetBits
|
||||
@@ -694,13 +694,13 @@
|
||||
|
||||
// Internal Module
|
||||
#define HARDWARE_INTERNAL_MODULE
|
||||
#if defined(PCBXLITES) || defined(PCBX3)
|
||||
#if defined(PCBXLITES) || defined(PCBX9LITE)
|
||||
#define INTMODULE_NO_PXX1
|
||||
#endif
|
||||
#if defined(PCBXLITE) || defined(PCBX3)
|
||||
#if defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define INTMODULE_RCC_APB1Periph RCC_APB1Periph_TIM3
|
||||
#define INTMODULE_RCC_APB2Periph RCC_APB2Periph_USART1
|
||||
#if defined(PCBXLITES) || defined(PCBX3)
|
||||
#if defined(PCBXLITES) || defined(PCBX9LITE)
|
||||
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA2)
|
||||
#define INTMODULE_PWR_GPIO GPIOA
|
||||
#define INTMODULE_PWR_GPIO_PIN GPIO_Pin_15 // PA.15
|
||||
@@ -776,9 +776,9 @@
|
||||
// External Module
|
||||
#define EXTMODULE_PULSES
|
||||
|
||||
#if defined(PCBXLITE) || defined(PCBX3)
|
||||
#if defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define EXTMODULE_RCC_APB2Periph (RCC_APB2Periph_TIM8 | RCC_APB2Periph_USART6)
|
||||
#if defined(PCBX3)
|
||||
#if defined(PCBX9LITE)
|
||||
#define EXTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_DMA2)
|
||||
#define EXTMODULE_PWR_GPIO GPIOA
|
||||
#define EXTMODULE_PWR_GPIO_PIN GPIO_Pin_8 // PA.08
|
||||
@@ -842,7 +842,7 @@
|
||||
#endif
|
||||
|
||||
// Trainer Port
|
||||
#if defined(PCBXLITES) || defined(PCBX3)
|
||||
#if defined(PCBXLITES) || defined(PCBX9LITE)
|
||||
// on these 2 radios the trainer port already uses DMA1_Stream6, we won't use the DMA
|
||||
#define TRAINER_RCC_AHB1Periph RCC_AHB1Periph_GPIOD
|
||||
#define TRAINER_RCC_APB1Periph RCC_APB1Periph_TIM4
|
||||
@@ -851,7 +851,7 @@
|
||||
#define TRAINER_IN_GPIO_PinSource GPIO_PinSource13
|
||||
#define TRAINER_OUT_GPIO_PIN GPIO_Pin_12 // PD.12
|
||||
#define TRAINER_OUT_GPIO_PinSource GPIO_PinSource12
|
||||
#if defined(PCBX3)
|
||||
#if defined(PCBX9LITE)
|
||||
#define TRAINER_DETECT_GPIO GPIOD
|
||||
#define TRAINER_DETECT_GPIO_PIN GPIO_Pin_11 // PD.11
|
||||
#endif
|
||||
@@ -913,7 +913,7 @@
|
||||
#endif
|
||||
|
||||
// Serial Port
|
||||
#if defined(PCBX7) || defined(PCBXLITE) || defined(PCBX3)
|
||||
#if defined(PCBX7) || defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define SERIAL_RCC_AHB1Periph 0
|
||||
#define SERIAL_RCC_APB1Periph 0
|
||||
#else
|
||||
@@ -938,7 +938,7 @@
|
||||
#define TELEMETRY_RCC_APB1Periph RCC_APB1Periph_USART2
|
||||
#define TELEMETRY_DIR_GPIO GPIOD
|
||||
#define TELEMETRY_DIR_GPIO_PIN GPIO_Pin_4 // PD.04
|
||||
#if defined(PCBXLITE) || defined(PCBX3)
|
||||
#if defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define TELEMETRY_DIR_OUTPUT() TELEMETRY_DIR_GPIO->BSRRH = TELEMETRY_DIR_GPIO_PIN
|
||||
#define TELEMETRY_DIR_INPUT() TELEMETRY_DIR_GPIO->BSRRL = TELEMETRY_DIR_GPIO_PIN
|
||||
#else
|
||||
@@ -984,7 +984,7 @@
|
||||
#define SPORT_UPDATE_PWR_GPIO_PIN GPIO_Pin_2 // PB.02
|
||||
#define GPIO_SPORT_UPDATE_PWR_GPIO_ON GPIO_SetBits
|
||||
#define GPIO_SPORT_UPDATE_PWR_GPIO_OFF GPIO_ResetBits
|
||||
#elif defined(PCBX3)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define SPORT_MAX_BAUDRATE 250000 // not tested
|
||||
#define SPORT_UPDATE_RCC_AHB1Periph RCC_AHB1Periph_GPIOE
|
||||
#define SPORT_UPDATE_PWR_GPIO GPIOE
|
||||
@@ -997,7 +997,7 @@
|
||||
#endif
|
||||
|
||||
// Heartbeat
|
||||
#if defined(PCBXLITE) || defined(PCBX3)
|
||||
#if defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define HEARTBEAT_RCC_AHB1Periph RCC_AHB1Periph_GPIOD
|
||||
#define HEARTBEAT_RCC_APB2Periph 0
|
||||
#define HEARTBEAT_GPIO GPIOD
|
||||
@@ -1055,7 +1055,7 @@
|
||||
#define BACKLIGHT_GPIO_PinSource_2 GPIO_PinSource13
|
||||
#define BACKLIGHT_GPIO_AF_1 GPIO_AF_TIM4
|
||||
#define BACKLIGHT_GPIO_AF_2 GPIO_AF_TIM4
|
||||
#elif defined(PCBXLITES) || defined(PCBX3)
|
||||
#elif defined(PCBXLITES) || defined(PCBX9LITE)
|
||||
#define BACKLIGHT_RCC_AHB1Periph RCC_AHB1Periph_GPIOA
|
||||
#define BACKLIGHT_RCC_APB1Periph 0
|
||||
#define BACKLIGHT_RCC_APB2Periph RCC_APB2Periph_TIM1
|
||||
@@ -1128,7 +1128,7 @@
|
||||
#define LCD_DMA_FLAG_INT DMA_HIFCR_CTCIF7
|
||||
#define LCD_SPI SPI3
|
||||
#define LCD_GPIO_AF GPIO_AF_SPI3
|
||||
#elif defined(PCBXLITE) || defined(PCBX3)
|
||||
#elif defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define LCD_RCC_AHB1Periph (RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_DMA1)
|
||||
#define LCD_RCC_APB1Periph RCC_APB1Periph_SPI3
|
||||
#define LCD_SPI_GPIO GPIOC
|
||||
@@ -1188,7 +1188,7 @@
|
||||
#define I2C_RCC_APB1Periph RCC_APB1Periph_I2C1
|
||||
#define I2C I2C1
|
||||
#define I2C_GPIO_AF GPIO_AF_I2C1
|
||||
#if defined(PCBXLITE) || defined(PCBX3)
|
||||
#if defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define I2C_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOD)
|
||||
#define I2C_SPI_GPIO GPIOB
|
||||
#define I2C_SDA_GPIO_PIN GPIO_Pin_9 // PB.09
|
||||
@@ -1238,7 +1238,7 @@
|
||||
#define SD_RCC_AHB1Periph (RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA1)
|
||||
#define SD_RCC_APB1Periph RCC_APB1Periph_SPI2
|
||||
#define SD_GPIO_PRESENT_GPIO GPIOD
|
||||
#if defined(PCBXLITE) || defined(PCBX3)
|
||||
#if defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define SD_GPIO_PRESENT_GPIO_PIN GPIO_Pin_10 // PD.10
|
||||
#else
|
||||
#define SD_GPIO_PRESENT_GPIO_PIN GPIO_Pin_9 // PD.09
|
||||
@@ -1290,7 +1290,7 @@
|
||||
#endif
|
||||
|
||||
// Haptic
|
||||
#if defined(PCBXLITE) || defined(PCBX3)
|
||||
#if defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
#define HAPTIC_PWM
|
||||
#define HAPTIC_RCC_AHB1Periph RCC_AHB1Periph_GPIOB
|
||||
#define HAPTIC_RCC_APB1Periph RCC_APB1Periph_TIM2
|
||||
|
||||
@@ -182,15 +182,15 @@ uint32_t switchState(uint8_t index)
|
||||
ADD_3POS_CASE(A, 0);
|
||||
ADD_3POS_CASE(B, 1);
|
||||
ADD_3POS_CASE(C, 2);
|
||||
#if !defined(PCBX3)
|
||||
#if !defined(PCBX9LITE)
|
||||
ADD_3POS_CASE(D, 3);
|
||||
#endif
|
||||
#if defined(PCBXLITES) || defined(PCBX3)
|
||||
#if defined(PCBXLITES) || defined(PCBX9LITE)
|
||||
ADD_2POS_CASE(E);
|
||||
ADD_2POS_CASE(F);
|
||||
// no SWG and SWH on XLITES and X3
|
||||
#elif defined(PCBXLITE) || defined(PCBX3)
|
||||
// no SWE, SWF, SWG and SWH on X3 and XLITE
|
||||
// no SWG and SWH on XLITES and X9
|
||||
#elif defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
// no SWE, SWF, SWG and SWH on X9LITE and XLITE
|
||||
#elif defined(PCBX7)
|
||||
ADD_2POS_CASE(F);
|
||||
ADD_2POS_CASE(H);
|
||||
|
||||
@@ -308,7 +308,7 @@ int sbusGetByte(uint8_t * byte)
|
||||
case TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE:
|
||||
return heartbeatFifo.pop(*byte);
|
||||
#endif
|
||||
#if !defined(PCBX7) && !defined(PCBX9E) && !defined(PCBX3) && !defined(PCBXLITE)
|
||||
#if !defined(PCBX7) && !defined(PCBX9E) && !defined(PCBX9LITE) && !defined(PCBXLITE)
|
||||
case TRAINER_MODE_MASTER_BATTERY_COMPARTMENT:
|
||||
return serial2RxFifo.pop(*byte);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user