Preliminary T18 support (#7581)

This commit is contained in:
3djc
2020-06-22 21:15:47 +02:00
committed by GitHub
parent 02b61fff24
commit 2d01916055
76 changed files with 952 additions and 426 deletions
+3
View File
@@ -1,6 +1,9 @@
if(PCB STREQUAL X12S)
set(BITMAP_TARGET_PREFIX x12s)
set(BITMAP_FMT_SUFFIX "")
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T18)
set(BITMAP_TARGET_PREFIX x10)
set(BITMAP_FMT_SUFFIX "")
else()
set(BITMAP_TARGET_PREFIX x10)
set(BITMAP_FMT_SUFFIX "-R")
+5
View File
@@ -744,7 +744,12 @@ PACK(struct RadioData {
uint8_t backlightMode:3;
int8_t antennaMode:2;
uint8_t disableRtcWarning:1;
#if defined(KEYS_BACKLIGHT_GPIO)
uint8_t keysBacklight:1;
int8_t spare1:1;
#else
int8_t spare1:2;
#endif
NOBACKUP(TrainerData trainer);
NOBACKUP(uint8_t view); // index of view in main screen
NOBACKUP(BUZZER_FIELD); /* 2bits */
+4 -1
View File
@@ -1544,7 +1544,10 @@ void menuModelSetup(event_t event)
if (multi_proto == MODULE_SUBTYPE_MULTI_FS_AFHDS2A)
optionValue = 50 + 5 * optionValue;
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, optionValue, LEFT | attr);
if (multi_proto == MODULE_SUBTYPE_MULTI_FRSKY_R9)
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_MULTI_POWER, optionValue, LEFT | attr);
else
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, optionValue, LEFT | attr);
if (attr) {
int8_t min, max;
getMultiOptionValues(multi_proto, min, max);
+1 -1
View File
@@ -76,6 +76,6 @@ void menuRadioDiagKeys(event_t event)
#if defined(ROTARY_ENCODER_NAVIGATION)
coord_t y = MENU_HEADER_HEIGHT + 1 + FH*KEY_COUNT;
lcdDrawText(0, y, STR_ROTARY_ENCODER);
lcdDrawNumber(5*FW+FWNUM+2, y, rotencValue, RIGHT);
lcdDrawNumber(5*FW+FWNUM+2, y, rotencValue / ROTARY_ENCODER_GRANULARITY, RIGHT);
#endif
}
+4 -1
View File
@@ -1309,7 +1309,10 @@ void menuModelSetup(event_t event)
if (multi_proto == MODULE_SUBTYPE_MULTI_FS_AFHDS2A)
optionValue = 50 + 5 * optionValue;
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, optionValue, LEFT | attr);
if (multi_proto == MODULE_SUBTYPE_MULTI_FRSKY_R9)
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_MULTI_POWER, optionValue, LEFT | attr);
else
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, optionValue, LEFT | attr);
if (attr) {
int8_t min, max;
getMultiOptionValues(multi_proto, min, max);
+1 -1
View File
@@ -59,6 +59,6 @@ void menuRadioDiagKeys(event_t event)
#if defined(ROTARY_ENCODER_NAVIGATION)
coord_t y = MENU_HEADER_HEIGHT + 1 + FH*KEY_COUNT;
lcdDrawText(0, y, STR_ROTARY_ENCODER);
lcdDrawNumber(5*FW+FWNUM+2, y, rotencValue, RIGHT);
lcdDrawNumber(5*FW+FWNUM+2, y, rotencValue / ROTARY_ENCODER_GRANULARITY, RIGHT);
#endif
}
+4 -4
View File
@@ -25,7 +25,7 @@
#include "colors.h"
#include "rle.h"
#if defined(PCBX10) && !defined(SIMU)
#if defined(LCD_VERTICAL_INVERT)
#define MOVE_PIXEL_RIGHT(p, count) p -= count
#else
#define MOVE_PIXEL_RIGHT(p, count) p += count
@@ -100,7 +100,7 @@ class BitmapBufferBase
inline const display_t * getPixelPtr(coord_t x, coord_t y) const
{
#if defined(PCBX10) && !defined(SIMU)
#if defined(LCD_VERTICAL_INVERT)
x = width - x - 1;
y = height - y - 1;
#endif
@@ -201,7 +201,7 @@ class BitmapBuffer: public BitmapBufferBase<uint16_t>
inline const display_t * getPixelPtr(coord_t x, coord_t y) const
{
#if defined(PCBX10) && !defined(SIMU)
#if defined(LCD_VERTICAL_INVERT)
x = width - x - 1;
y = height - y - 1;
#endif
@@ -210,7 +210,7 @@ class BitmapBuffer: public BitmapBufferBase<uint16_t>
inline display_t * getPixelPtr(coord_t x, coord_t y)
{
#if defined(PCBX10) && !defined(SIMU)
#if defined(LCD_VERTICAL_INVERT)
x = width - x - 1;
y = height - y - 1;
#endif
+1 -1
View File
@@ -156,7 +156,7 @@ void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags attr);
#define DOTTED 0x55
#define STASHED 0x33
#if defined(PCBX10) && !defined(SIMU)
#if defined(LCD_VERTICAL_INVERT)
#define PIXEL_PTR(x, y) &displayBuf[(LCD_H*LCD_W-1) - (y)*LCD_W - (x)]
#else
#define PIXEL_PTR(x, y) &displayBuf[(y)*LCD_W + (x)]
+4 -1
View File
@@ -1686,7 +1686,10 @@ bool menuModelSetup(event_t event)
if (multi_proto == MODULE_SUBTYPE_MULTI_FS_AFHDS2A)
optionValue = 50 + 5 * optionValue;
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, optionValue, LEFT | attr);
if (multi_proto == MODULE_SUBTYPE_MULTI_FRSKY_R9)
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_MULTI_POWER, optionValue, LEFT | attr);
else
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, optionValue, LEFT | attr);
if (attr) {
int8_t min, max;
getMultiOptionValues(multi_proto, min, max);
+1 -1
View File
@@ -73,7 +73,7 @@ bool menuRadioDiagKeys(event_t event)
#if defined(ROTARY_ENCODER_NAVIGATION)
coord_t y = MENU_HEADER_HEIGHT + FH * (8 - KEY_START);
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_ROTARY_ENCODER);
lcdDrawNumber(70, y, rotencValue, 0);
lcdDrawNumber(70, y, rotencValue / ROTARY_ENCODER_GRANULARITY, 0);
#endif
return true;
+17 -3
View File
@@ -65,6 +65,9 @@ enum menuRadioSetupItems {
ITEM_SETUP_BACKLIGHT_DELAY,
ITEM_SETUP_BRIGHTNESS,
ITEM_SETUP_DIM_LEVEL,
#if defined(KEYS_BACKLIGHT_GPIO)
ITEM_SETUP_KEYS_BACKLIGHT,
#endif
ITEM_SETUP_FLASH_BEEP,
CASE_PWR_BUTTON_PRESS(ITEM_SETUP_PWR_OFF_SPEED)
#if defined(PXX2)
@@ -110,6 +113,11 @@ bool menuRadioSetup(event_t event)
#else
#define FAI_CHOICE_ROW
#endif
#if defined(KEYS_BACKLIGHT_GPIO)
#define BACKLIGHT_ROWS LABEL(BACKLIGHT), 0, 0, 0, 0, 0, 0,
#else
#define BACKLIGHT_ROWS LABEL(BACKLIGHT), 0, 0, 0, 0, 0,
#endif
MENU(STR_MENURADIOSETUP, RADIO_ICONS, menuTabGeneral, MENU_RADIO_SETUP, ITEM_SETUP_MAX, {
2|NAVIGATION_LINE_BY_LINE, 2|NAVIGATION_LINE_BY_LINE, 1|NAVIGATION_LINE_BY_LINE, // Date Time Bat range
@@ -117,7 +125,7 @@ bool menuRadioSetup(event_t event)
CASE_VARIO(LABEL(VARIO)) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0)
CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0)
LABEL(ALARMS), 0, 0, 0, 0,
LABEL(BACKLIGHT), 0, 0, 0, 0, 0,
BACKLIGHT_ROWS
CASE_PWR_BUTTON_PRESS(0)
CASE_PXX2(0) // owner registration ID
CASE_GPS(LABEL(GPS))
@@ -373,7 +381,7 @@ bool menuRadioSetup(event_t event)
break;
case ITEM_SETUP_BACKLIGHT_MODE:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_MODE);
lcdDrawText(MENUS_MARGIN_LEFT + INDENT_WIDTH , y, STR_MODE);
g_eeGeneral.backlightMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr, event);
break;
@@ -388,7 +396,6 @@ bool menuRadioSetup(event_t event)
editName(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID, event, attr);
break;
#endif
case ITEM_SETUP_BACKLIGHT_DELAY:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BLDELAY);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT, 0, NULL, "s");
@@ -405,6 +412,13 @@ bool menuRadioSetup(event_t event)
g_eeGeneral.blOffBright = editSlider(RADIO_SETUP_2ND_COLUMN, y, event, g_eeGeneral.blOffBright, BACKLIGHT_LEVEL_MIN, BACKLIGHT_LEVEL_MAX, attr);
break;
#if defined(KEYS_BACKLIGHT_GPIO)
case ITEM_SETUP_KEYS_BACKLIGHT:
lcdDrawText(MENUS_MARGIN_LEFT + INDENT_WIDTH , y, STR_KEYS_BACKLIGHT);
g_eeGeneral.keysBacklight = editCheckBox(g_eeGeneral.keysBacklight, RADIO_SETUP_2ND_COLUMN, y, attr, event ) ;
break;
#endif
#if defined(PWR_BUTTON_PRESS)
case ITEM_SETUP_PWR_OFF_SPEED:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_PWR_OFF_DELAY);
@@ -139,6 +139,8 @@ class DarkblueTheme: public Theme
delete calibHorus;
#if defined(RADIO_T16)
calibHorus = BitmapBuffer::load(getThemePath("t16.bmp"));
#elif defined(RADIO_T18)
calibHorus = BitmapBuffer::load(getThemePath("t18.bmp"));
#elif defined(RADIO_TX16S)
calibHorus = BitmapBuffer::load(getThemePath("tx16s.bmp"));
#elif defined(PCBX10)
+2
View File
@@ -176,6 +176,8 @@ class DefaultTheme: public Theme
delete calibHorus;
#if defined(RADIO_T16)
calibHorus = BitmapBuffer::load(getThemePath("t16.bmp"));
#elif defined(RADIO_T18)
calibHorus = BitmapBuffer::load(getThemePath("t18.bmp"));
#elif defined(RADIO_TX16S)
calibHorus = BitmapBuffer::load(getThemePath("tx16s.bmp"));
#elif defined(PCBX10)
+2 -1
View File
@@ -921,7 +921,8 @@ const char* mm_options_strings::options[] = {
STR_MULTI_TELEMETRY,
STR_MULTI_SERVOFREQ,
STR_MULTI_MAX_THROW,
STR_MULTI_RFCHAN
STR_MULTI_RFCHAN,
STR_MULTI_RFPOWER
};
const mm_protocol_definition multi_protocols[] = {
+4
View File
@@ -2073,6 +2073,10 @@ int main()
inline uint32_t PWR_PRESS_SHUTDOWN_DELAY()
{
// Instant off when both power button are pressed
if (pwrForcePressed())
return 0;
return (2 - g_eeGeneral.pwrOffSpeed) * 100;
}
+1 -1
View File
@@ -536,7 +536,7 @@ bool setTrimValue(uint8_t phase, uint8_t idx, int trim);
#if defined(PCBSKY9X)
#define ROTARY_ENCODER_GRANULARITY (2 << g_eeGeneral.rotarySteps)
#elif defined(RADIO_FAMILY_T16)
#elif defined(RADIO_FAMILY_T16) && !defined(RADIO_T18)
#define ROTARY_ENCODER_GRANULARITY (1)
#else
#define ROTARY_ENCODER_GRANULARITY (2)
+4
View File
@@ -666,6 +666,10 @@ inline void getMultiOptionValues(int8_t multi_proto, int8_t & min, int8_t & max)
min = -1;
max = 84;
break;
case MODULE_SUBTYPE_MULTI_FRSKY_R9:
min = 0; // 10mW
max = 5; // 300mW
break;
default:
min = -128;
max = 127;
+2
View File
@@ -128,6 +128,8 @@ const char * getBasename(const char * path);
#define OTX_FOURCC 0x3478746F // otx for X12S
#elif defined(RADIO_T16)
#define OTX_FOURCC 0x3F78746F // otx for Jumper T16
#elif defined(RADIO_T18)
#define OTX_FOURCC 0x4078746F // otx for Jumper T18
#elif defined(RADIO_TX16S)
#define OTX_FOURCC 0x3878746F // otx for Radiomaster TX16S
#elif defined(PCBX10)
@@ -24,6 +24,8 @@
// not needed
#elif defined(RADIO_T16)
const int8_t adcDirection[NUM_ANALOGS] = {1,-1,1,-1, 1,1,1, -1,1, -1,1};
#elif defined(RADIO_T18)
const int8_t adcDirection[NUM_ANALOGS] = { 1,-1,1,-1, -1,1,-1, -1,1, -1,1 };
#elif defined(RADIO_TX16S)
const int8_t adcDirection[NUM_ANALOGS] = {1,-1,1,-1, 1,1,1, -1,1, -1,1};
#elif defined(PCBX10)
@@ -197,7 +197,8 @@ int main()
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph | KEYS_RCC_AHB1Periph |
LCD_RCC_AHB1Periph | BACKLIGHT_RCC_AHB1Periph |
AUX_SERIAL_RCC_AHB1Periph | AUX2_SERIAL_RCC_AHB1Periph | I2C_RCC_AHB1Periph |
AUX_SERIAL_RCC_AHB1Periph | AUX2_SERIAL_RCC_AHB1Periph |
I2C_RCC_AHB1Periph | KEYS_BACKLIGHT_RCC_AHB1Periph |
SD_RCC_AHB1Periph, ENABLE);
RCC_APB1PeriphClockCmd(ROTARY_ENCODER_RCC_APB1Periph | LCD_RCC_APB1Periph | BACKLIGHT_RCC_APB1Periph |
@@ -51,6 +51,12 @@ void pwrInit()
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
GPIO_Init(PWR_SWITCH_GPIO, &GPIO_InitStructure);
#if defined(PWR_EXTRA_SWITCH_GPIO)
// PWR Extra switch
GPIO_InitStructure.GPIO_Pin = PWR_EXTRA_SWITCH_GPIO_PIN;
GPIO_Init(PWR_EXTRA_SWITCH_GPIO, &GPIO_InitStructure);
#endif
#if defined(PCBREV_HARDCODED)
hardwareOptions.pcbrev = PCBREV_HARDCODED;
#elif defined(PCBREV_GPIO_PIN)
@@ -101,9 +107,20 @@ void pwrOff()
GPIO_ResetBits(PWR_ON_GPIO, PWR_ON_GPIO_PIN);
}
#if defined(PWR_EXTRA_SWITCH_GPIO)
bool pwrForcePressed()
{
return (GPIO_ReadInputDataBit(PWR_SWITCH_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET && GPIO_ReadInputDataBit(PWR_EXTRA_SWITCH_GPIO, PWR_EXTRA_SWITCH_GPIO_PIN) == Bit_RESET);
}
#endif
bool pwrPressed()
{
#if defined(PWR_EXTRA_SWITCH_GPIO)
return (GPIO_ReadInputDataBit(PWR_SWITCH_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET || GPIO_ReadInputDataBit(PWR_EXTRA_SWITCH_GPIO, PWR_EXTRA_SWITCH_GPIO_PIN) == Bit_RESET);
#else
return GPIO_ReadInputDataBit(PWR_SWITCH_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
#endif
}
void pwrResetHandler()
@@ -71,7 +71,7 @@ void rotaryEncoderInit()
void rotaryEncoderCheck()
{
#if defined(RADIO_FAMILY_T16)
#if defined(RADIO_FAMILY_T16) && !defined(RADIO_T18)
static uint8_t state = 0;
uint8_t pins = ROTARY_ENCODER_POSITION();
+7
View File
@@ -71,6 +71,13 @@ if (PCB STREQUAL X10)
set(AUX2_SERIAL ON)
endif()
set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS")
elseif (PCBREV STREQUAL T18)
set(FLAVOUR t18)
set(LUA_EXPORT lua_export_t16)
add_definitions(-DRADIO_T18)
add_definitions(-DRADIO_FAMILY_T16)
option(INTERNAL_MODULE_MULTI "Support for MULTI internal module" ON)
option(BLUETOOTH "Support for bluetooth module" OFF)
else()
set(FLAVOUR x10)
option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module" ON)
@@ -32,6 +32,15 @@ void backlightInit()
GPIO_Init(BACKLIGHT_GPIO, &GPIO_InitStructure);
GPIO_PinAFConfig(BACKLIGHT_GPIO, BACKLIGHT_GPIO_PinSource, BACKLIGHT_GPIO_AF);
#if defined(KEYS_BACKLIGHT_GPIO)
GPIO_InitStructure.GPIO_Pin = KEYS_BACKLIGHT_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(KEYS_BACKLIGHT_GPIO, &GPIO_InitStructure);
#endif
// TIMER init
#if defined(PCBX12S) && PCBREV >= 13
BACKLIGHT_TIMER->ARR = 100;
@@ -72,6 +81,15 @@ void backlightEnable(uint8_t dutyCycle)
BACKLIGHT_TIMER->CCR3 = BACKLIGHT_LEVEL_MAX - dutyCycle;
#endif
#if defined(KEYS_BACKLIGHT_GPIO) && !defined(BOOT)
if (dutyCycle == 0 || g_eeGeneral.keysBacklight == 0) {
GPIO_ResetBits(KEYS_BACKLIGHT_GPIO, KEYS_BACKLIGHT_GPIO_PIN);
}
else {
GPIO_SetBits(KEYS_BACKLIGHT_GPIO, KEYS_BACKLIGHT_GPIO_PIN);
}
#endif
if (dutyCycle == 0) {
BACKLIGHT_TIMER->BDTR &= ~TIM_BDTR_MOE;
}
+1
View File
@@ -103,6 +103,7 @@ void boardInit()
LED_RCC_AHB1Periph |
LCD_RCC_AHB1Periph |
BACKLIGHT_RCC_AHB1Periph |
KEYS_BACKLIGHT_RCC_AHB1Periph |
SD_RCC_AHB1Periph |
AUDIO_RCC_AHB1Periph |
KEYS_RCC_AHB1Periph |
+9
View File
@@ -492,6 +492,11 @@ void pwrOn();
void pwrOff();
void pwrResetHandler();
bool pwrPressed();
#if defined(PWR_EXTRA_SWITCH_GPIO)
bool pwrForcePressed();
#else
#define pwrForcePressed() false
#endif
uint32_t pwrPressedDuration();
// USB Charger
@@ -555,6 +560,10 @@ void usbJoystickUpdate();
#define USB_NAME "Jumper T16"
#define USB_MANUFACTURER 'J', 'u', 'm', 'p', 'e', 'r', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'T', '1', '6', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_T18)
#define USB_NAME "Jumper T18"
#define USB_MANUFACTURER 'J', 'u', 'm', 'p', 'e', 'r', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'T', '1', '8', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_TX16S)
#define USB_NAME "RadioMas TX16S"
#define USB_MANUFACTURER 'R', 'a', 'd', 'i', 'o', 'M', 'a', 's' /* 8 bytes */
+22 -1
View File
@@ -322,7 +322,7 @@
#define ADC_TRANSFER_COMPLETE() (ADC_DMA->LISR & DMA_LISR_TCIF0)
#if defined(RADIO_TX16S)
#define ADC_VREF_PREC2 330
#elif defined(RADIO_T16)
#elif defined(RADIO_T16) || defined(RADIO_T18)
#define ADC_VREF_PREC2 300
#else
#define ADC_VREF_PREC2 250
@@ -330,11 +330,21 @@
#endif
// Power
#if defined(RADIO_T18)
#define PWR_RCC_AHB1Periph RCC_AHB1Periph_GPIOJ | RCC_AHB1Periph_GPIOB
#define PWR_ON_GPIO GPIOJ
#define PWR_ON_GPIO_PIN GPIO_Pin_1 // PJ.01
#define PWR_SWITCH_GPIO GPIOJ
#define PWR_SWITCH_GPIO_PIN GPIO_Pin_0 // PJ.00
#define PWR_EXTRA_SWITCH_GPIO GPIOB
#define PWR_EXTRA_SWITCH_GPIO_PIN GPIO_Pin_0 // PB.00
#else
#define PWR_RCC_AHB1Periph RCC_AHB1Periph_GPIOJ
#define PWR_ON_GPIO GPIOJ
#define PWR_ON_GPIO_PIN GPIO_Pin_1 // PJ.01
#define PWR_SWITCH_GPIO GPIOJ
#define PWR_SWITCH_GPIO_PIN GPIO_Pin_0 // PJ.00
#endif
// USB Charger
#if defined(USB_CHARGER)
@@ -514,6 +524,9 @@
#define LCD_GPIO_NRST GPIOI
#define LCD_GPIO_PIN_NRST GPIO_Pin_10 // PI.10
#endif
#if defined(PCBX10) && !defined(RADIO_T18) && !defined(SIMU)
#define LCD_VERTICAL_INVERT
#endif
#define LTDC_IRQ_PRIO 4
#define DMA_SCREEN_IRQ_PRIO 6
@@ -549,6 +562,14 @@
#define BACKLIGHT_GPIO_AF GPIO_AF_TIM8
#define BACKLIGHT_TIMER_FREQ (PERI2_FREQUENCY * TIMER_MULT_APB2)
#endif
#if defined(RADIO_T18)
#define KEYS_BACKLIGHT_RCC_AHB1Periph RCC_AHB1Periph_GPIOC
#define KEYS_BACKLIGHT_GPIO GPIOC
#define KEYS_BACKLIGHT_GPIO_PIN GPIO_Pin_4 // PC.04
#define KEYS_BACKLIGHT_GPIO_PinSource GPIO_PinSource4
#else
#define KEYS_BACKLIGHT_RCC_AHB1Periph 0
#endif
// SD
#define SD_RCC_AHB1Periph (RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_DMA2)
+24 -9
View File
@@ -20,14 +20,25 @@
#include "opentx.h"
#define HBP 42
#define VBP 12
#if defined(RADIO_T18)
#define HBP 43
#define VBP 12
#define HSW 2
#define VSW 10
#define HSW 2
#define VSW 4
#define HFP 3
#define VFP 2
#define HFP 8
#define VFP 8
#else
#define HBP 42
#define VBP 12
#define HSW 2
#define VSW 10
#define HFP 3
#define VFP 2
#endif
#define LCD_FIRST_LAYER 0
#define LCD_SECOND_LAYER 1
@@ -315,7 +326,11 @@ void LCD_Init(void)
{
/* Reset the LCD --------------------------------------------------------*/
LCD_NRSTConfig();
#if defined(RADIO_T18) // T18 seems to have eractic display issue if NRST is ever driven low
NRST_HIGH();
#else
lcd_reset();
#endif
/* Configure the LCD Control pins */
LCD_AF_GPIOConfig();
@@ -383,7 +398,7 @@ void lcdInit(void)
void DMAFillRect(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color)
{
#if defined(PCBX10)
#if defined(LCD_VERTICAL_INVERT)
x = destw - (x + w);
y = desth - (y + h);
#endif
@@ -415,7 +430,7 @@ void DMAFillRect(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, ui
void DMACopyBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, const uint16_t * src, uint16_t srcw, uint16_t srch, uint16_t srcx, uint16_t srcy, uint16_t w, uint16_t h)
{
#if defined(PCBX10)
#if defined(LCD_VERTICAL_INVERT)
x = destw - (x + w);
y = desth - (y + h);
srcx = srcw - (srcx + w);
@@ -458,7 +473,7 @@ void DMACopyBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x,
void DMACopyAlphaBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, const uint16_t * src, uint16_t srcw, uint16_t srch, uint16_t srcx, uint16_t srcy, uint16_t w, uint16_t h)
{
#if defined(PCBX10)
#if defined(LCD_VERTICAL_INVERT)
x = destw - (x + w);
y = desth - (y + h);
srcx = srcw - (srcx + w);
+1
View File
@@ -377,6 +377,7 @@ void pwrOn();
uint32_t pwrCheck();
bool pwrPressed();
#define UNEXPECTED_SHUTDOWN() (g_eeGeneral.unexpectedShutdown)
#define pwrForcePressed() (false)
// EEPROM driver
#define EEPROM_SIZE (4*1024*1024/8)
+1
View File
@@ -648,6 +648,7 @@ bool pwrPressed();
uint32_t pwrPressedDuration();
#endif
void pwrResetHandler();
#define pwrForcePressed() false
#if defined(SIMU)
#define UNEXPECTED_SHUTDOWN() false
+1
View File
@@ -1639,6 +1639,7 @@
#define BACKLIGHT_GPIO_PinSource GPIO_PinSource8
#define BACKLIGHT_GPIO_AF GPIO_AF_TIM10
#endif
#define KEYS_BACKLIGHT_RCC_AHB1Periph 0
// LCD driver
#if defined(PCBX9E)
+3
View File
@@ -96,6 +96,7 @@ ISTR(INPUTNAMES);
#if defined(MULTIMODULE)
ISTR(MULTI_PROTOCOLS);
ISTR(MULTI_POWER);
#endif
#if defined(BLUETOOTH)
@@ -654,6 +655,7 @@ const char STR_GYRO_MAX[] = TR_GYRO_MAX;
#if defined(PWM_BACKLIGHT) || defined(COLORLCD)
const char STR_BLONBRIGHTNESS[] = TR_BLONBRIGHTNESS;
const char STR_BLOFFBRIGHTNESS[] = TR_BLOFFBRIGHTNESS;
const char STR_KEYS_BACKLIGHT[] = TR_KEYS_BACKLIGHT;
#endif
const char STR_TIMEZONE[] = TR_TIMEZONE;
@@ -694,6 +696,7 @@ const char STR_BIND_OK[] = TR_BIND_OK;
const char STR_MULTI_CUSTOM[] = TR_MULTI_CUSTOM;
const char STR_MULTI_RFTUNE[] = TR_MULTI_RFTUNE;
const char STR_MULTI_RFPOWER[] = TR_MULTI_RFPOWER;
const char STR_MULTI_TELEMETRY[] = TR_MULTI_TELEMETRY;
const char STR_MULTI_VIDFREQ[] = TR_MULTI_VIDFREQ;
const char STR_MULTI_OPTION[] = TR_MULTI_OPTION;
+3 -3
View File
@@ -159,10 +159,8 @@ extern const char STR_XJT_ACCST_RF_PROTOCOLS[];
extern const char STR_ISRM_RF_PROTOCOLS[];
extern const char STR_R9M_PXX2_RF_PROTOCOLS[];
extern const char STR_DSM_PROTOCOLS[];
#if defined(MULTIMODULE)
extern const char STR_MULTI_PROTOCOLS[];
#endif
extern const char STR_MULTI_POWER[];
#if defined(AFHDS3)
extern const char STR_AFHDS3_ONE_TO_ONE_TELEMETRY[];
@@ -305,6 +303,7 @@ extern const char STR_BLDELAY[];
#if defined(PWM_BACKLIGHT) || defined(COLORLCD)
extern const char STR_BLONBRIGHTNESS[];
extern const char STR_BLOFFBRIGHTNESS[];
extern const char STR_KEYS_BACKLIGHT[];
#endif
extern const char STR_SPLASHSCREEN[];
@@ -399,6 +398,7 @@ extern const char STR_MULTI_FIXEDID[];
extern const char STR_MULTI_OPTION[];
extern const char STR_MULTI_VIDFREQ[];
extern const char STR_MULTI_RFTUNE[];
extern const char STR_MULTI_RFPOWER[];
extern const char STR_MULTI_TELEMETRY[];
extern const char STR_MULTI_AUTOBIND[];
extern const char STR_DISABLE_CH_MAP[];
+2
View File
@@ -522,6 +522,7 @@
#define TR_BLDELAY INDENT"Zhasnout po"
#define TR_BLONBRIGHTNESS TR3(INDENT"Jas Zap.", INDENT"Jas Zap.", INDENT"Jas zapnutého LCD")
#define TR_BLOFFBRIGHTNESS TR3(INDENT"Jas Vyp.", INDENT"Jas Vyp.", INDENT"Jas vypnutého LCD")
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Barva"
#define TR_SPLASHSCREEN TR("úvodní logo", "Zobrazit úvodní logo")
#define TR_PWR_ON_DELAY "Pwr On delay"
@@ -628,6 +629,7 @@
#define TR_RECEIVER_NUM TR("RX číslo", "Číslo přijímače")
#define TR_RECEIVER "Přijímač"
#define TR_MULTI_RFTUNE TR(INDENT "Ladění frek", INDENT "Jemné ladění frek. RF")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetrie"
#define TR_MULTI_VIDFREQ TR(INDENT "Freq. videa", INDENT "Frekvence videa")
#define TR_RFPOWER "Výkon RF"
+2
View File
@@ -524,6 +524,7 @@
#define TR_BLDELAY INDENT "Dauer"
#define TR_BLONBRIGHTNESS INDENT "An-Helligkeit"
#define TR_BLOFFBRIGHTNESS INDENT "Aus-Helligkeit"
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Farbe"
#define TR_SPLASHSCREEN TR("Startbild Ein", "Startbild Anzeigedauer")
#define TR_PWR_ON_DELAY "Pwr On delay"
@@ -630,6 +631,7 @@
#define TR_RECEIVER_NUM TR("Empf Nr.", "Empfänger Nummer")
#define TR_RECEIVER "Empfänger"
#define TR_MULTI_RFTUNE TR(INDENT "RF Freq.", INDENT "RF Freq. Feintuning")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetry"
#define TR_MULTI_VIDFREQ TR(INDENT "Vid. Freq.", INDENT "Video Frequenz")
#define TR_RFPOWER "RF Power"
+2
View File
@@ -523,6 +523,7 @@
#define TR_BLDELAY INDENT "Duration"
#define TR_BLONBRIGHTNESS INDENT "ON brightness"
#define TR_BLOFFBRIGHTNESS INDENT "OFF brightness"
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Color"
#define TR_SPLASHSCREEN "Splash screen"
#define TR_PWR_ON_DELAY "Pwr On delay"
@@ -629,6 +630,7 @@
#define TR_RECEIVER_NUM TR("RxNum", "Receiver No.")
#define TR_RECEIVER "Receiver"
#define TR_MULTI_RFTUNE TR("Freq tune", "RF Freq. fine tune")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetry"
#define TR_MULTI_VIDFREQ TR("Vid. freq.", "Video frequency")
#define TR_RFPOWER "RF Power"
+2
View File
@@ -522,6 +522,7 @@
#define TR_BLDELAY INDENT"Duración"
#define TR_BLONBRIGHTNESS INDENT"MAS brillo"
#define TR_BLOFFBRIGHTNESS INDENT"MENOS brillo"
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Color"
#define TR_SPLASHSCREEN "Pantalla inicio"
#define TR_PWR_ON_DELAY TR("Atraso On", "Atraso encendido")
@@ -631,6 +632,7 @@
#define TR_RECEIVER_NUM TR("Num Rx", "Receptor No.")
#define TR_RECEIVER "Receptor"
#define TR_MULTI_RFTUNE TR("Sint.freq.", "RF Freq. sint.fina")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetría"
#define TR_MULTI_VIDFREQ TR("Freq.vídeo", "Frecuencia vídeo")
#define TR_RFPOWER "RF Power"
+2
View File
@@ -536,6 +536,7 @@
#define TR_BLDELAY INDENT"Duration"
#define TR_BLONBRIGHTNESS INDENT"ON Brightness"
#define TR_BLOFFBRIGHTNESS INDENT"OFF Brightness"
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Color"
#define TR_SPLASHSCREEN "Splash screen"
#define TR_PWR_ON_DELAY "Pwr On delay"
@@ -647,6 +648,7 @@
#define TR_RECEIVER_NUM TR("RxNum", "Receiver No.")
#define TR_RECEIVER "Receiver"
#define TR_MULTI_RFTUNE TR("Freq tune", "RF Freq. fine tune")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetry"
#define TR_MULTI_VIDFREQ TR("Vid. freq.", "Video frequency")
#define TR_RFPOWER "RF Power"
+2
View File
@@ -542,6 +542,7 @@
#define TR_BLDELAY INDENT "Durée"
#define TR_BLONBRIGHTNESS INDENT "Luminosité ON"
#define TR_BLOFFBRIGHTNESS INDENT "Luminosité OFF"
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Couleur"
#define TR_SPLASHSCREEN "Logo d'accueil"
#define TR_PWR_ON_DELAY "Délai btn ON"
@@ -650,6 +651,7 @@
#define TR_RECEIVER_NUM TR("NumRx", "No. récepteur")
#define TR_RECEIVER "Récept."
#define TR_MULTI_RFTUNE TR(INDENT "Ajust.fréq", INDENT "Ajustement fréq.")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Télémétrie"
#define TR_MULTI_VIDFREQ TR(INDENT "Fréq. vidéo", INDENT "Fréquence vidéo")
#define TR_RFPOWER TR("Puiss. RF", "Puissance RF")
+2
View File
@@ -544,6 +544,7 @@
#define TR_BLDELAY INDENT "Durata"
#define TR_BLONBRIGHTNESS TR(INDENT "Lumin. ON", INDENT "Luminosità ON")
#define TR_BLOFFBRIGHTNESS TR(INDENT "Lumin. OFF", INDENT "Luminosità OFF")
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Colore"
#define TR_SPLASHSCREEN TR("Sch. avvio", "Schermata d'avvio")
#define TR_PWR_ON_DELAY "Rit. accens."
@@ -649,6 +650,7 @@
#define TR_RECEIVER_NUM TR("RxNum", "Ricevente N.")
#define TR_RECEIVER "Ricevente"
#define TR_MULTI_RFTUNE TR("Tune RF", "Tune fine Freq. RF")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetria"
#define TR_MULTI_VIDFREQ TR("Freq. video", "Frequenza video")
#define TR_RFPOWER "Potenza RF"
+2
View File
@@ -525,6 +525,7 @@
#define TR_BLDELAY INDENT "Duur"
#define TR_BLONBRIGHTNESS INDENT "Aan-Helderheid"
#define TR_BLOFFBRIGHTNESS INDENT "Uit-Helderheid"
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Kleur"
#define TR_SPLASHSCREEN "Startscherm Aan"
#define TR_PWR_ON_DELAY "Pwr On delay"
@@ -635,6 +636,7 @@
#define TR_RECEIVER_NUM TR("RxNum", "Receiver Nr.")
#define TR_RECEIVER "Receiver"
#define TR_MULTI_RFTUNE TR("Freq tune", "RF Freq. fine tune")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetry"
#define TR_MULTI_VIDFREQ TR("Vid. freq.", "Video frequency")
#define TR_RFPOWER "RF Power"
+2
View File
@@ -543,6 +543,7 @@
#define TR_BLDELAY INDENT"Czas trwania"
#define TR_BLONBRIGHTNESS INDENT"Jasnośc wł."
#define TR_BLOFFBRIGHTNESS INDENT"Jasność wył."
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Color"
#define TR_SPLASHSCREEN "Logo ekranu"
#define TR_PWR_ON_DELAY "Pwr On delay"
@@ -648,6 +649,7 @@
#define TR_RECEIVER_NUM TR("Nr RX", "Nr odbiornika")
#define TR_RECEIVER INDENT "Receiver"
#define TR_MULTI_RFTUNE TR("Freq tune", "RF Freq. fine tune")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetry"
#define TR_MULTI_VIDFREQ TR("Vid. freq.", "Video frequency")
#define TR_RFPOWER "RF Power"
+2
View File
@@ -529,6 +529,7 @@
#define TR_BLDELAY INDENT "Tempo Backlight"
#define TR_BLONBRIGHTNESS INDENT "ON Brightness"
#define TR_BLOFFBRIGHTNESS INDENT "OFF Brightness"
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_BLCOLOR INDENT "Color"
#define TR_SPLASHSCREEN "Splash screen"
#define TR_PWR_ON_DELAY "Pwr On delay"
@@ -639,6 +640,7 @@
#define TR_RECEIVER "Receiver"
#define TR_SYNCMENU "Sync [MENU]"
#define TR_MULTI_RFTUNE TR("Freq tune", "RF Freq. fine tune")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetry"
#define TR_MULTI_VIDFREQ TR("Vid. freq.", "Video frequency")
#define TR_RFPOWER "RF Power"
+2
View File
@@ -542,6 +542,7 @@
#define TR_BLDELAY INDENT "Av efter"
#define TR_BLONBRIGHTNESS INDENT "På Ljusstyrka"
#define TR_BLOFFBRIGHTNESS INDENT "Av Ljusstyrka"
#define TR_KEYS_BACKLIGHT "Keys backlight"
#define TR_SPLASHSCREEN "Startbild"
#define TR_PWR_ON_DELAY "Pwr On delay"
#define TR_PWR_OFF_DELAY "Pwr Off delay"
@@ -648,6 +649,7 @@
#define TR_RECEIVER "Receiver"
#define TR_SYNCMENU "Synk [MENU]"
#define TR_MULTI_RFTUNE TR("Freq tune", "RF Freq. fine tune")
#define TR_MULTI_RFPOWER "RF power"
#define TR_MULTI_TELEMETRY "Telemetry"
#define TR_MULTI_VIDFREQ TR("Vid. freq.", "Video frequency")
#define TR_RFPOWER "RF Power"
+3 -1
View File
@@ -125,8 +125,10 @@
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
#define LEN_MULTI_PROTOCOLS "\007"
#define TR_MULTI_PROTOCOLS "FlySky\0""Hubsan\0""FrSky\0 ""Hisky\0 ""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0 ""KN\0 ""SymaX\0 ""SLT\0 ""CX10\0 ""CG023\0 ""Bayang\0""ESky\0 ""MT99XX\0""MJXq\0 ""Shenqi\0""FY326\0 ""SFHSS\0 ""J6 Pro\0""FQ777\0 ""Assan\0 ""Hontai\0""OpenLrs""FlSky2A""Q2x2\0 ""Walkera""Q303\0 ""GW008\0 ""DM002\0 ""Cabell\0""Esky150""H8 3D\0 ""Corona\0""CFlie\0 ""Hitec\0 ""WFly\0 ""Bugs\0 ""BugMini""Traxxas""NCC1701""E01X\0 ""V911S\0 ""GD00X\0 ""V761\0 ""KF606\0 ""Redpine""Potensi""ZSX\0 ""FlyZone""Scanner""FrSkyRX""FS2A_RX""HoTT\0 ""FX816\0 ""BayanRX""Pelikan""Tiger\0 ""XK\0 ""XN297DU""FrSkyX2""FrSkyR9""Propel\0""FrSkyL\0""Skyarte""ESky-v2""DSM RX\0""JJRC345""Q90C\0 "
#define TR_MULTI_PROTOCOLS "FlySky\0""Hubsan\0""FrSky\0 ""Hisky\0 ""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0 ""KN\0 ""SymaX\0 ""SLT\0 ""CX10\0 ""CG023\0 ""Bayang\0""ESky\0 ""MT99XX\0""MJXq\0 ""Shenqi\0""FY326\0 ""SFHSS\0 ""J6 Pro\0""FQ777\0 ""Assan\0 ""Hontai\0""OpenLrs""FlSky2A""Q2x2\0 ""Walkera""Q303\0 ""GW008\0 ""DM002\0 ""Cabell\0""Esky150""H8 3D\0 ""Corona\0""CFlie\0 ""Hitec\0 ""WFly\0 ""Bugs\0 ""BugMini""Traxxas""NCC1701""E01X\0 ""V911S\0 ""GD00X\0 ""V761\0 ""KF606\0 ""Redpine""Potensi""ZSX\0 ""FlyZone""Scanner""FrSkyRX""FS2A_RX""HoTT\0 ""FX816\0 ""BayanRX""Pelikan""Tiger\0 ""XK\0 ""XN297DU""FrSkyX2""FrSkyR9""Propel\0""FrSkyL\0""Skyartc""ESky-v2""DSM RX\0""JJRC345""Q90C\0 "
#define LEN_MULTI_POWER "\005"
#define TR_MULTI_POWER "10mW\0""25mW\0""50mW\0""100mW""200mW""300mW""500mW""1W\0 ""2W\0 "
#define LEN_AFHDS3_PROTOCOLS "\x008"
#define TR_AFHDS3_PROTOCOLS "PWM/IBUS""PWM/SBUS""PPM/IBUS""PPM/SBUS"