Jumper TLite support
This commit is contained in:
@@ -251,7 +251,7 @@ void menuRadioSetup(event_t event)
|
||||
putsVolts(lcdLastRightPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
|
||||
if (attr && s_editMode>0) {
|
||||
if (menuHorizontalPosition==0)
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -50, g_eeGeneral.vBatMax+29); // min=4.0V
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -60, g_eeGeneral.vBatMax+29); // min=3.0V
|
||||
else
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMax, g_eeGeneral.vBatMin-29, +40); // max=16.0V
|
||||
}
|
||||
@@ -411,7 +411,7 @@ void menuRadioSetup(event_t event)
|
||||
case ITEM_RADIO_SETUP_BATTERY_WARNING:
|
||||
lcdDrawTextAlignedLeft(y, STR_BATTERYWARNING);
|
||||
putsVolts(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.vBatWarn, attr|LEFT);
|
||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V
|
||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 30, 120); //3-12V
|
||||
break;
|
||||
|
||||
case ITEM_RADIO_SETUP_MEMORY_WARNING:
|
||||
|
||||
@@ -195,19 +195,29 @@ enum {
|
||||
ITEM_RADIO_HARDWARE_MAX
|
||||
};
|
||||
|
||||
#if (NUM_POTS + NUM_SLIDERS) == 1
|
||||
#if (NUM_POTS + NUM_SLIDERS) == 0
|
||||
#define POT_LABEL_ROW HIDDEN_ROW
|
||||
#define POTS_ROWS HIDDEN_ROW
|
||||
#elif (NUM_POTS + NUM_SLIDERS) == 1
|
||||
#define POT_LABEL_ROW LABEL(Pots)
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1
|
||||
#elif (NUM_POTS + NUM_SLIDERS) == 2
|
||||
#define POT_LABEL_ROW LABEL(Pots)
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#elif (NUM_POTS + NUM_SLIDERS) == 3
|
||||
#define POT_LABEL_ROW LABEL(Pots)
|
||||
#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 POT_LABEL_ROW LABEL(Pots)
|
||||
#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
|
||||
#define POT_LABEL_ROW LABEL(Pots)
|
||||
#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
|
||||
#define POT_LABEL_ROW LABEL(Pots)
|
||||
#define POTS_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_POTS + NUM_SLIDERS) == 8
|
||||
#define POT_LABEL_ROW LABEL(Pots)
|
||||
#define POTS_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, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#endif
|
||||
|
||||
@@ -326,7 +336,7 @@ void menuRadioHardware(event_t event)
|
||||
0 /* stick 2 */,
|
||||
0 /* stick 3 */,
|
||||
0 /* stick 4 */,
|
||||
LABEL(Pots),
|
||||
POT_LABEL_ROW,
|
||||
POTS_ROWS,
|
||||
LABEL(Switches),
|
||||
SWITCHES_ROWS,
|
||||
|
||||
@@ -82,7 +82,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||
}
|
||||
#endif
|
||||
|
||||
if (event==EVT_KEY_FIRST(KEY_RIGHT) || event==EVT_KEY_REPT(KEY_RIGHT) || (s_editMode>0 && (IS_ROTARY_RIGHT(event) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_UP)))) {
|
||||
if ((s_editMode>0 && (IS_ROTARY_RIGHT(event) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_UP)))) {
|
||||
do {
|
||||
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||
newval += min(10, i_max-val);
|
||||
@@ -98,7 +98,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||
AUDIO_KEY_ERROR();
|
||||
}
|
||||
}
|
||||
else if (event==EVT_KEY_FIRST(KEY_LEFT) || event==EVT_KEY_REPT(KEY_LEFT) || (s_editMode>0 && (IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_REPT(KEY_DOWN)))) {
|
||||
else if ((s_editMode>0 && (IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_REPT(KEY_DOWN)))) {
|
||||
do {
|
||||
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||
newval -= min(10, val-i_min);
|
||||
|
||||
@@ -29,15 +29,6 @@ horzpos_t menuHorizontalPosition;
|
||||
|
||||
int8_t checkIncDec_Ret;
|
||||
|
||||
#if defined(RADIO_T12)
|
||||
#define DBLKEYS_PRESSED_RGT_LFT(in) ((in & (KEYS_GPIO_PIN_RIGHT + KEYS_GPIO_PIN_LEFT)) == (KEYS_GPIO_PIN_RIGHT + KEYS_GPIO_PIN_LEFT))
|
||||
// set to 0
|
||||
#define DBLKEYS_PRESSED_UP_DWN(in) ((in & (KEYS_GPIO_PIN_UP + KEYS_GPIO_PIN_DOWN)) == (KEYS_GPIO_PIN_UP + KEYS_GPIO_PIN_DOWN))
|
||||
// set to max
|
||||
#define DBLKEYS_PRESSED_RGT_UP(in) ((in & (KEYS_GPIO_PIN_RIGHT + KEYS_GPIO_PIN_UP)) == (KEYS_GPIO_PIN_RIGHT + KEYS_GPIO_PIN_UP))
|
||||
// set to min
|
||||
#define DBLKEYS_PRESSED_LFT_DWN(in) ((in & (KEYS_GPIO_PIN_LEFT + KEYS_GPIO_PIN_DOWN)) == (KEYS_GPIO_PIN_LEFT + KEYS_GPIO_PIN_DOWN))
|
||||
#else
|
||||
// invert the value
|
||||
#define DBLKEYS_PRESSED_RGT_LFT(in) ((in & ((1<<KEY_SHIFT) + (1<<KEY_UP))) == ((1<<KEY_SHIFT) + (1<<KEY_UP)))
|
||||
// set to 0
|
||||
@@ -46,7 +37,6 @@ int8_t checkIncDec_Ret;
|
||||
#define DBLKEYS_PRESSED_RGT_UP(in) ((in & ((1<<KEY_SHIFT) + (1<<KEY_RIGHT))) == ((1<<KEY_SHIFT) + (1<<KEY_RIGHT)))
|
||||
// set to min
|
||||
#define DBLKEYS_PRESSED_LFT_DWN(in) ((in & ((1<<KEY_SHIFT) + (1<<KEY_LEFT))) == ((1<<KEY_SHIFT) + (1<<KEY_LEFT)))
|
||||
#endif
|
||||
|
||||
INIT_STOPS(stops100, 3, -100, 0, 100)
|
||||
INIT_STOPS(stops1000, 3, -1000, 0, 1000)
|
||||
|
||||
@@ -28,6 +28,7 @@ if(PYTHONINTERP_FOUND)
|
||||
add_lua_export_target(x10 ${LUA_INCLUDES} -DPCBHORUS -DPCBX10)
|
||||
add_lua_export_target(x12s ${LUA_INCLUDES} -DPCBHORUS -DPCBX12S)
|
||||
add_lua_export_target(t12 ${LUA_INCLUDES} -DPCBTARANIS -DPCBX7 -DRADIO_T12)
|
||||
add_lua_export_target(tlite ${LUA_INCLUDES} -DPCBTARANIS -DPCBX7 -DRADIO_TLITE)
|
||||
add_lua_export_target(tx12 ${LUA_INCLUDES} -DPCBTARANIS -DPCBX7 -DRADIO_TX12)
|
||||
add_lua_export_target(t16 ${LUA_INCLUDES} -DPCBHORUS -DPCBX10 -DRADIO_T16)
|
||||
endif()
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#include "lua/lua_exports_x7.inc"
|
||||
#elif defined(RADIO_T12)
|
||||
#include "lua/lua_exports_t12.inc"
|
||||
#elif defined(RADIO_TLITE)
|
||||
#include "lua/lua_exports_tlite.inc"
|
||||
#elif defined(RADIO_TX12)
|
||||
#include "lua/lua_exports_tx12.inc"
|
||||
#elif defined(PCBX9LITES)
|
||||
|
||||
@@ -475,7 +475,7 @@ bool setupPulsesInternalModule(uint8_t protocol)
|
||||
#endif
|
||||
|
||||
default:
|
||||
scheduleNextMixerCalculation(INTERNAL_MODULE, 10 /*ms*/); // used for USB sim for example
|
||||
scheduleNextMixerCalculation(INTERNAL_MODULE, 10 /* ms */); // used for USB sim for example
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,6 +143,8 @@ const char * getBasename(const char * path);
|
||||
#define OTX_FOURCC 0x3978746F // otx for Taranis X-Lite
|
||||
#elif defined(RADIO_T12)
|
||||
#define OTX_FOURCC 0x3D78746F // otx for Jumper T12
|
||||
#elif defined(RADIO_TLITE)
|
||||
#define OTX_FOURCC 0x4278746F // otx for Jumper TLite
|
||||
#elif defined(RADIO_TX12)
|
||||
#define OTX_FOURCC 0x4178746F // otx for Radiomaster TX12
|
||||
#elif defined(PCBX7)
|
||||
|
||||
+1
-1
@@ -255,7 +255,7 @@ void OpenTxSim::updateKeysAndSwitches(bool start)
|
||||
KEY_Down, KEY_DOWN,
|
||||
KEY_Right, KEY_RIGHT,
|
||||
KEY_Left, KEY_LEFT,
|
||||
#elif defined(PCBXLITE) || defined(RADIO_T12)
|
||||
#elif defined(PCBXLITE) || defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#if defined(KEYS_GPIO_REG_SHIFT)
|
||||
KEY_Shift_L, KEY_SHIFT,
|
||||
#endif
|
||||
|
||||
@@ -125,6 +125,9 @@ void adcInit()
|
||||
ADC_MAIN->SQR2 = (ADC_CHANNEL_BATT << 0) + (ADC_Channel_Vbat << 5);
|
||||
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_POT2 << 25);
|
||||
}
|
||||
#elif defined(RADIO_TLITE)
|
||||
ADC_MAIN->SQR2 = (ADC_CHANNEL_BATT << 0) + (ADC_Channel_Vbat << 5);
|
||||
ADC_MAIN->SQR3 = (ADC_CHANNEL_STICK_LH << 0) + (ADC_CHANNEL_STICK_LV << 5) + (ADC_CHANNEL_STICK_RV << 10) + (ADC_CHANNEL_STICK_RH << 15);
|
||||
#elif defined(PCBX7)
|
||||
ADC_MAIN->SQR2 = (ADC_CHANNEL_BATT << 0) + (ADC_Channel_Vbat << 5);
|
||||
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_POT2 << 25);
|
||||
@@ -136,7 +139,7 @@ void adcInit()
|
||||
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_POT2 << 25);
|
||||
#endif
|
||||
|
||||
ADC_MAIN->SMPR1 = (ADC_SAMPTIME << 0) + (ADC_SAMPTIME << 3) + (ADC_SAMPTIME << 6) + (ADC_SAMPTIME << 9) + (ADC_SAMPTIME << 12) + (ADC_SAMPTIME << 15) + (ADC_SAMPTIME << 18) + (ADC_SAMPTIME << 21) + (ADC_SAMPTIME << 24);
|
||||
ADC_MAIN->SMPR1 = (ADC_SAMPTIME << 0) + (ADC_SAMPTIME << 3) + (ADC_SAMPTIME << 6) + (ADC_SAMPTIME << 9) + (ADC_SAMPTIME << 12) + (ADC_SAMPTIME << 15) + (ADC_SAMPTIME << 18) + (ADC_SAMPTIME << 21) + (VBAT_ADC_SAMPTIME << 24);
|
||||
ADC_MAIN->SMPR2 = (ADC_SAMPTIME << 0) + (ADC_SAMPTIME << 3) + (ADC_SAMPTIME << 6) + (ADC_SAMPTIME << 9) + (ADC_SAMPTIME << 12) + (ADC_SAMPTIME << 15) + (ADC_SAMPTIME << 18) + (ADC_SAMPTIME << 21) + (ADC_SAMPTIME << 24) + (ADC_SAMPTIME << 27);
|
||||
|
||||
ADC->CCR = ADC_CCR_VBATE; // Enable vbat sensor
|
||||
|
||||
@@ -89,7 +89,7 @@ set(BOOTLOADER_SRC
|
||||
bin_files.cpp
|
||||
)
|
||||
|
||||
if(PCB STREQUAL X12S OR PCB STREQUAL X10 OR PCB STREQUAL X9E OR (PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019) OR (PCB STREQUAL X7 AND NOT (PCBREV STREQUAL T12)) OR PCB STREQUAL X9LITE OR PCB STREQUAL X9LITES)
|
||||
if(ROTARY_ENCODER)
|
||||
set(BOOTLOADER_SRC
|
||||
${BOOTLOADER_SRC}
|
||||
../../../../../targets/common/arm/stm32/rotary_encoder_driver.cpp
|
||||
|
||||
@@ -20,6 +20,7 @@ set(LINKER_SCRIPT targets/horus/stm32f4_flash.ld)
|
||||
set(RTC_BACKUP_RAM YES)
|
||||
set(PPM_LIMITS_SYMETRICAL YES)
|
||||
set(USB_SERIAL ON CACHE BOOL "Enable USB serial (CDC)")
|
||||
set(ROTARY_ENCODER YES)
|
||||
|
||||
# for size report script
|
||||
set(CPU_TYPE_FULL STM32F429xI)
|
||||
|
||||
@@ -275,6 +275,7 @@
|
||||
#define ADC_DMA DMA2
|
||||
#define ADC_DMA_Stream DMA2_Stream0
|
||||
#define ADC_SAMPTIME 3
|
||||
#define VBAT_ADC_SAMPTIME ADC_SAMPTIME
|
||||
#define ADC_VREF_PREC2 300
|
||||
#elif defined(PCBX10)
|
||||
#define ADC_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOF | RCC_AHB1Periph_DMA2)
|
||||
@@ -315,6 +316,7 @@
|
||||
#define ADC_CHANNEL_EXT2 ADC_Channel_7 // ADC3_IN7
|
||||
#define ADC_MAIN ADC3
|
||||
#define ADC_SAMPTIME 3
|
||||
#define VBAT_ADC_SAMPTIME ADC_SAMPTIME
|
||||
#define ADC_DMA DMA2
|
||||
#define ADC_DMA_SxCR_CHSEL DMA_SxCR_CHSEL_1
|
||||
#define ADC_DMA_Stream DMA2_Stream0
|
||||
|
||||
@@ -128,8 +128,21 @@ elseif(PCB STREQUAL X7)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(LUA_EXPORT lua_export_t12)
|
||||
add_definitions(-DRADIO_T12)
|
||||
add_definitions(-DRADIO_FAMILY_JUMPER_T12)
|
||||
add_definitions(-DEEPROM_VARIANT=0x4001)
|
||||
add_definitions(-DMANUFACTURER_JUMPER)
|
||||
elseif(PCBREV STREQUAL TLITE)
|
||||
option(INTERNAL_MODULE_MULTI "Support for MULTI internal module" ON)
|
||||
set(FLAVOUR tlite)
|
||||
set(NAVIGATION_TYPE 9x)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(LUA_EXPORT lua_export_tlite)
|
||||
add_definitions(-DRADIO_TLITE)
|
||||
add_definitions(-DRADIO_FAMILY_JUMPER_T12)
|
||||
add_definitions(-DEEPROM_VARIANT=0x4003)
|
||||
add_definitions(-DMANUFACTURER_JUMPER)
|
||||
elseif(PCBREV STREQUAL TX12)
|
||||
option(INTERNAL_MODULE_MULTI "Support for MULTI internal module" ON)
|
||||
set(FLAVOUR tx12)
|
||||
|
||||
@@ -117,7 +117,7 @@ uint32_t isBootloaderStart(const uint8_t * buffer);
|
||||
#define INTERNAL_MODULE_OFF() GPIO_ResetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN)
|
||||
#endif
|
||||
|
||||
#if !defined(PCBX9LITE) || defined(PCBX9LITES)
|
||||
#if (defined(INTERNAL_MODULE_PXX1) || defined(INTERNAL_MODULE_PXX2)) && (!defined(PCBX9LITE) || defined(PCBX9LITES))
|
||||
#define HARDWARE_INTERNAL_RAS
|
||||
#endif
|
||||
|
||||
@@ -432,7 +432,12 @@ enum EnumSwitchesPositions
|
||||
#define STORAGE_NUM_SWITCHES 6
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 2) + (POT_WITHOUT_DETENT << 0)
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_TLITE)
|
||||
#define NUM_SWITCHES 4
|
||||
#define STORAGE_NUM_SWITCHES 8
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (0)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define NUM_SWITCHES 8
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 10) + (SWITCH_2POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
@@ -544,6 +549,11 @@ enum Analogs {
|
||||
#define NUM_SLIDERS 0
|
||||
#define STORAGE_NUM_POTS 1
|
||||
#define STORAGE_NUM_SLIDERS 0
|
||||
#elif defined(RADIO_TLITE)
|
||||
#define NUM_POTS 0
|
||||
#define NUM_SLIDERS 0
|
||||
#define STORAGE_NUM_POTS 2
|
||||
#define STORAGE_NUM_SLIDERS 0
|
||||
#elif defined(PCBXLITE) || defined(PCBX7)
|
||||
#define NUM_POTS 2
|
||||
#define NUM_SLIDERS 0
|
||||
@@ -644,6 +654,11 @@ extern uint16_t adcValues[NUM_ANALOGS];
|
||||
#define BATTERY_WARN 66 // 6.6V
|
||||
#define BATTERY_MIN 67 // 6.7V
|
||||
#define BATTERY_MAX 83 // 8.3V
|
||||
#elif defined(RADIO_TLITE)
|
||||
// 1S Li-ion / Lipo
|
||||
#define BATTERY_WARN 33 // 3.3V
|
||||
#define BATTERY_MIN 32 // 3.2V
|
||||
#define BATTERY_MAX 42 // 4.2V
|
||||
#else
|
||||
// NI-MH 7.2V
|
||||
#define BATTERY_WARN 65 // 6.5V
|
||||
@@ -710,6 +725,10 @@ uint8_t isBacklightEnabled();
|
||||
#define USB_NAME "Radiomaster TX12"
|
||||
#define USB_MANUFACTURER 'R', 'M', '_', 'T', 'X', ' ', ' ', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'R', 'M', ' ', 'T', 'X', '1', '2', ' ' /* 8 Bytes */
|
||||
#elif defined(RADIO_TLITE)
|
||||
#define USB_NAME "Jumper TLite"
|
||||
#define USB_MANUFACTURER 'J', 'U', 'M', 'P', 'E', 'R', ' ', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'T', '-', 'L', 'I', 'T', 'E', ' ', ' ' /* 8 Bytes */
|
||||
#else
|
||||
#define USB_NAME "FrSky Taranis"
|
||||
#define USB_MANUFACTURER 'F', 'r', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */
|
||||
@@ -889,8 +908,8 @@ void ledBlue();
|
||||
#define IS_LCD_RESET_NEEDED() true
|
||||
#define LCD_CONTRAST_MIN 10
|
||||
#define LCD_CONTRAST_MAX 30
|
||||
#if defined(RADIO_TX12)
|
||||
#define LCD_CONTRAST_DEFAULT 21
|
||||
#if defined(RADIO_TX12) || defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LCD_CONTRAST_DEFAULT 25
|
||||
#else
|
||||
#define LCD_CONTRAST_DEFAULT 15
|
||||
#endif
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#define KEYS_GPIO_PIN_LEFT GPIO_Pin_12 // PE.12
|
||||
#define KEYS_GPIO_REG_RIGHT GPIOE->IDR
|
||||
#define KEYS_GPIO_PIN_RIGHT GPIO_Pin_13 // PE.13
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define KEYS_GPIO_REG_EXIT GPIOD->IDR
|
||||
#define KEYS_GPIO_PIN_EXIT GPIO_Pin_2 // PD.02
|
||||
#define KEYS_GPIO_REG_ENTER GPIOE->IDR
|
||||
@@ -362,6 +362,13 @@
|
||||
#define SWITCHES_GPIO_PIN_B_L GPIO_Pin_6 // PA.06
|
||||
#define SWITCHES_GPIO_REG_B_H GPIOA->IDR
|
||||
#define SWITCHES_GPIO_PIN_B_H GPIO_Pin_5 // PA.05
|
||||
#elif defined(RADIO_TLITE)
|
||||
#define STORAGE_SWITCH_B
|
||||
#define HARDWARE_SWITCH_B
|
||||
#define SWITCHES_GPIO_REG_B_L GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_B_L GPIO_Pin_1 // PE.01
|
||||
#define SWITCHES_GPIO_REG_B_H GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_B_H GPIO_Pin_2 // PE.02
|
||||
#elif defined(PCBX7)
|
||||
#define STORAGE_SWITCH_B
|
||||
#define HARDWARE_SWITCH_B
|
||||
@@ -406,6 +413,11 @@
|
||||
#define SWITCHES_GPIO_PIN_C_L GPIO_Pin_11 // PD.11
|
||||
#define SWITCHES_GPIO_REG_C_H GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_C_H GPIO_Pin_0 // PE.00
|
||||
#elif defined(RADIO_TLITE)
|
||||
#define STORAGE_SWITCH_C
|
||||
#define HARDWARE_SWITCH_C
|
||||
#define SWITCHES_GPIO_REG_C GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_C GPIO_Pin_14 // PE.14
|
||||
#elif defined(PCBX7)
|
||||
#define STORAGE_SWITCH_C
|
||||
#define HARDWARE_SWITCH_C
|
||||
@@ -453,6 +465,11 @@
|
||||
#define HARDWARE_SWITCH_D
|
||||
#define SWITCHES_GPIO_REG_D GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_D GPIO_Pin_8 // PE.08
|
||||
#elif defined(RADIO_TLITE)
|
||||
#define STORAGE_SWITCH_D
|
||||
#define HARDWARE_SWITCH_D
|
||||
#define SWITCHES_GPIO_REG_D GPIOD->IDR
|
||||
#define SWITCHES_GPIO_PIN_D GPIO_Pin_14 // PD.14
|
||||
#elif defined(PCBX7)
|
||||
#define STORAGE_SWITCH_D
|
||||
#define HARDWARE_SWITCH_D
|
||||
@@ -539,6 +556,9 @@
|
||||
#define SWITCHES_GPIO_PIN_F_L GPIO_Pin_1 // PE.01
|
||||
#define SWITCHES_GPIO_REG_F_H GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_F_H GPIO_Pin_2 // PE.02
|
||||
#elif defined(RADIO_TLITE)
|
||||
// no SWF
|
||||
#define STORAGE_SWITCH_F
|
||||
#elif defined(PCBX7)
|
||||
#define STORAGE_SWITCH_F
|
||||
#define HARDWARE_SWITCH_F
|
||||
@@ -587,6 +607,9 @@
|
||||
#elif defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
// no SWH
|
||||
#elif defined(RADIO_TX12)
|
||||
#elif defined(RADIO_TLITE)
|
||||
// no SWH
|
||||
#define STORAGE_SWITCH_H
|
||||
#elif defined(PCBX7)
|
||||
#define STORAGE_SWITCH_H
|
||||
#define HARDWARE_SWITCH_H
|
||||
@@ -624,6 +647,11 @@
|
||||
#define HARDWARE_SWITCH_J
|
||||
#define SWITCHES_GPIO_REG_J GPIOD->IDR
|
||||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_14 // PD.14
|
||||
#elif defined(RADIO_TLITE)
|
||||
// no SWI
|
||||
#define STORAGE_SWITCH_I
|
||||
// no SWJ
|
||||
#define STORAGE_SWITCH_J
|
||||
#elif defined(PCBX7)
|
||||
#define STORAGE_SWITCH_I
|
||||
#define HARDWARE_SWITCH_I
|
||||
@@ -733,7 +761,7 @@
|
||||
#define KEYS_GPIOB_PINS (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5)
|
||||
#define KEYS_GPIOC_PINS (GPIO_Pin_4 | GPIO_Pin_5)
|
||||
#define KEYS_GPIOE_PINS (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14)
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#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_GPIOC_PINS (GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3)
|
||||
@@ -789,6 +817,11 @@
|
||||
#define ADC_SET_DMA_FLAGS() ADC_DMA->HIFCR = (DMA_HIFCR_CTCIF4 | DMA_HIFCR_CHTIF4 | DMA_HIFCR_CTEIF4 | DMA_HIFCR_CDMEIF4 | DMA_HIFCR_CFEIF4)
|
||||
#define ADC_TRANSFER_COMPLETE() (ADC_DMA->HISR & DMA_HISR_TCIF4)
|
||||
#define ADC_SAMPTIME 2 // sample time = 28 cycles
|
||||
#if defined(RADIO_TLITE)
|
||||
#define VBAT_ADC_SAMPTIME (ADC_SAMPTIME + 1)
|
||||
#else
|
||||
#define VBAT_ADC_SAMPTIME ADC_SAMPTIME
|
||||
#endif
|
||||
#if defined(PCBX9E)
|
||||
#define HARDWARE_POT1
|
||||
#define HARDWARE_POT2
|
||||
@@ -900,6 +933,24 @@
|
||||
#define ADC_CHANNEL_POT2 ADC_Channel_12 // ADC1_IN12
|
||||
#define ADC_CHANNEL_BATT ADC_Channel_10 // ADC1_IN10
|
||||
#define ADC_VREF_PREC2 330
|
||||
#elif defined(RADIO_TLITE)
|
||||
#define ADC_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | 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_BATT GPIO_Pin_0 // PC.00
|
||||
#define ADC_GPIOA_PINS (ADC_GPIO_PIN_STICK_RV | ADC_GPIO_PIN_STICK_RH | ADC_GPIO_PIN_STICK_LH | ADC_GPIO_PIN_STICK_LV)
|
||||
#define ADC_GPIOB_PINS 0
|
||||
#define ADC_GPIOC_PINS ADC_GPIO_PIN_BATT
|
||||
#define ADC_CHANNEL_BATT ADC_Channel_10
|
||||
#define ADC_VREF_PREC2 330
|
||||
#elif defined(PCBX7)
|
||||
#define HARDWARE_POT1
|
||||
#define HARDWARE_POT2
|
||||
@@ -1152,7 +1203,7 @@
|
||||
#define INTMODULE_DMA_STREAM_IRQHandler DMA2_Stream5_IRQHandler
|
||||
#define INTMODULE_DMA_FLAG_TC DMA_IT_TCIF5
|
||||
#define INTMODULE_TIMER_FREQ (PERI2_FREQUENCY * TIMER_MULT_APB2)
|
||||
#elif defined(RADIO_T12) || defined(RADIO_TX12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12) || defined(RADIO_TX12)
|
||||
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA1)
|
||||
#define INTMODULE_RCC_APB1Periph (RCC_APB1Periph_USART3 | RCC_APB1Periph_TIM2)
|
||||
#define INTMODULE_RCC_APB2Periph 0
|
||||
@@ -1692,7 +1743,7 @@
|
||||
#define KEYS_BACKLIGHT_RCC_AHB1Periph 0
|
||||
|
||||
// LCD driver
|
||||
#if defined(RADIO_TX12) || defined(RADIO_T12)
|
||||
#if defined(RADIO_TX12) || defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LCD_VERTICAL_INVERT
|
||||
#endif
|
||||
#if defined(PCBX9E)
|
||||
@@ -1887,11 +1938,15 @@
|
||||
#define AUDIO_SPEAKER_ENABLE_GPIO_PIN GPIO_Pin_14 // PD.14
|
||||
#define HEADPHONE_TRAINER_SWITCH_GPIO GPIOD
|
||||
#define HEADPHONE_TRAINER_SWITCH_GPIO_PIN GPIO_Pin_9 // PD.09
|
||||
#elif defined(RADIO_TX12)
|
||||
#elif defined(RADIO_TX12) || defined(RADIO_TLITE)
|
||||
#define AUDIO_RCC_AHB1Periph (RCC_AHB1Periph_GPIOE | RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_DMA1)
|
||||
#define AUDIO_MUTE_GPIO GPIOE
|
||||
#define AUDIO_MUTE_GPIO_PIN GPIO_Pin_12 // PE.12
|
||||
#if defined(RADIO_TLITE)
|
||||
#define AUDIO_UNMUTE_DELAY 250 // ms
|
||||
#else
|
||||
#define AUDIO_UNMUTE_DELAY 150 // ms
|
||||
#endif
|
||||
#define AUDIO_MUTE_DELAY 500 // ms
|
||||
#else
|
||||
#define AUDIO_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_DMA1)
|
||||
@@ -2013,7 +2068,7 @@
|
||||
#define BT_USART_IRQn USART3_IRQn
|
||||
// #define BT_DMA_Stream_RX DMA1_Stream1
|
||||
// #define BT_DMA_Channel_RX DMA_Channel_4
|
||||
#elif defined(PCBX9D) || defined(PCBX9DP) || defined(RADIO_T12) || defined(RADIO_TX12)
|
||||
#elif defined(PCBX9D) || defined(PCBX9DP) || defined(RADIO_FAMILY_JUMPER_T12) || defined(RADIO_TX12)
|
||||
#define STORAGE_BLUETOOTH
|
||||
#define BT_RCC_AHB1Periph 0
|
||||
#define BT_RCC_APB1Periph 0
|
||||
|
||||
@@ -204,6 +204,11 @@ uint32_t switchState(uint8_t index)
|
||||
ADD_2POS_CASE(A);
|
||||
ADD_3POS_CASE(B, 1);
|
||||
ADD_3POS_CASE(C, 2);
|
||||
#elif defined(RADIO_TLITE)
|
||||
ADD_3POS_CASE(A, 0);
|
||||
ADD_3POS_CASE(B, 1);
|
||||
ADD_2POS_CASE(C);
|
||||
ADD_2POS_CASE(D);
|
||||
#else
|
||||
ADD_3POS_CASE(A, 0);
|
||||
ADD_3POS_CASE(B, 1);
|
||||
@@ -235,6 +240,8 @@ uint32_t switchState(uint8_t index)
|
||||
ADD_2POS_CASE(D);
|
||||
ADD_3POS_CASE(E, 4);
|
||||
ADD_3POS_CASE(F, 5);
|
||||
#elif defined(RADIO_TLITE)
|
||||
// Only 4 switches
|
||||
#elif defined(PCBX7)
|
||||
ADD_3POS_CASE(D, 3);
|
||||
ADD_2POS_CASE(F);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
#if defined(RADIO_T12) || defined(RADIO_TX12)
|
||||
#if defined(RADIO_FAMILY_JUMPER_T12) || defined(RADIO_TX12)
|
||||
#define LCD_CONTRAST_OFFSET -10
|
||||
#else
|
||||
#define LCD_CONTRAST_OFFSET 160
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Dolů\0""Nhoru""Vprvo""Vlevo"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -312,7 +312,7 @@
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Bas\0 ""Haut\0""Droit""Gauch"
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -315,7 +315,7 @@
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -312,7 +312,7 @@
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#elif defined(PCBXLITE)
|
||||
#define TR_POTS_VSRCRAW "\310S1\0""\310S2\0"
|
||||
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0"
|
||||
#elif defined(RADIO_T12)
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define TR_POTS_VSRCRAW "\310S1\0""\310S2\0"
|
||||
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0"
|
||||
#elif defined(RADIO_TX12)
|
||||
|
||||
Reference in New Issue
Block a user