diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index b6fa058e0..4b19b330e 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -1222,6 +1222,7 @@ void RegisterEepromInterfaces() eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_GRUVIN9X)); eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_SKY9X)); eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS)); + eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_PLUS)); if (g.rev4aSupport()) eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_REV4a)); eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK)); diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index 4a150066b..c9ee5d1f2 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -48,14 +48,16 @@ enum BoardEnum { BOARD_GRUVIN9X, BOARD_SKY9X, BOARD_TARANIS, + BOARD_TARANIS_PLUS, BOARD_TARANIS_REV4a }; -#define IS_9X(board) (board==BOARD_STOCK || board==BOARD_M128) -#define IS_STOCK(board) (board==BOARD_STOCK) -#define IS_2560(board) (board==BOARD_GRUVIN9X || board==BOARD_MEGA2560) -#define IS_ARM(board) (board==BOARD_SKY9X || board==BOARD_TARANIS || board==BOARD_TARANIS_REV4a) -#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_REV4a) +#define IS_9X(board) (board==BOARD_STOCK || board==BOARD_M128) +#define IS_STOCK(board) (board==BOARD_STOCK) +#define IS_2560(board) (board==BOARD_GRUVIN9X || board==BOARD_MEGA2560) +#define IS_ARM(board) (board==BOARD_SKY9X || board==BOARD_TARANIS || board==BOARD_TARANIS_REV4a || board==BOARD_TARANIS_PLUS) +#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_REV4a || board==BOARD_TARANIS_PLUS) +#define IS_TARANIS_PLUS(board) (board==BOARD_TARANIS_PLUS) const uint8_t modn12x3[4][4]= { {1, 2, 3, 4}, diff --git a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp index 16c93b06c..19cc53057 100644 --- a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp +++ b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp @@ -53,6 +53,7 @@ #define LUA_MODEL_SCRIPTS #define EEPROM_VARIANT 3 #define HAPTIC +#define REVPLUS #define NUM_POTS 5 diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 1bc8f2dd4..dcd9fdeaa 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -707,7 +707,7 @@ class FlightModeField: public TransformedField { for (int i=0; i(trimExt[i])); } - else if (board == BOARD_TARANIS && version >= 216) { + else if (IS_TARANIS(board) && version >= 216) { for (int i=0; i(phase.trim[i])); internalField.Append(new UnsignedField<5>(trimMode[i])); @@ -748,7 +748,7 @@ class FlightModeField: public TransformedField { virtual void beforeExport() { for (int i=0; i= 216) { + if (IS_TARANIS(board) && version >= 216) { if (phase.trimMode[i] < 0) trimMode[i] = TRIM_MODE_NONE; else @@ -776,7 +776,7 @@ class FlightModeField: public TransformedField { virtual void afterImport() { for (int i=0; i= 216) { + if (IS_TARANIS(board) && version >= 216) { if (trimMode[i] == TRIM_MODE_NONE) { phase.trimMode[i] = -1; } diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index 5f33720ad..f73e56b28 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -65,6 +65,8 @@ const char * OpenTxEepromInterface::getName() return "OpenTX for Gruvin9x board / 9X"; case BOARD_TARANIS: return "OpenTX for FrSky Taranis"; + case BOARD_TARANIS_PLUS: + return "OpenTX for FrSky Taranis Plus"; case BOARD_TARANIS_REV4a: return "OpenTX for FrSky Taranis Rev4a"; case BOARD_SKY9X: @@ -86,6 +88,7 @@ const int OpenTxEepromInterface::getEEpromSize() case BOARD_SKY9X: return EESIZE_SKY9X; case BOARD_TARANIS: + case BOARD_TARANIS_PLUS: return EESIZE_TARANIS; case BOARD_TARANIS_REV4a: return EESIZE_TARANIS_REV4a; @@ -359,6 +362,7 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t if (!version) { switch(board) { case BOARD_TARANIS: + case BOARD_TARANIS_PLUS: case BOARD_TARANIS_REV4a: case BOARD_SKY9X: version = 216; @@ -921,6 +925,7 @@ QString OpenTxFirmware::getFirmwareUrl(QString & id) break; case BOARD_SKY9X: case BOARD_TARANIS: + case BOARD_TARANIS_PLUS: case BOARD_TARANIS_REV4a: url.append(QString("/getfw.php?fw=%1.bin").arg(id)); break; @@ -947,6 +952,7 @@ QString OpenTxFirmware::getReleaseNotesUrl() url.append("9x.txt"); break; case BOARD_TARANIS: + case BOARD_TARANIS_PLUS: case BOARD_TARANIS_REV4a: url.append("taranis.txt"); break; @@ -979,6 +985,7 @@ QString OpenTxFirmware::getStampUrl() url.append("sky9x.txt"); break; case BOARD_TARANIS: + case BOARD_TARANIS_PLUS: case BOARD_TARANIS_REV4a: url.append("taranis.txt"); break; @@ -1001,6 +1008,7 @@ SimulatorInterface * OpenTxFirmware::getSimulator() case BOARD_SKY9X: return new Open9xSky9xSimulator(); case BOARD_TARANIS: + case BOARD_TARANIS_PLUS: case BOARD_TARANIS_REV4a: return new OpentxTaranisSimulator(); default: @@ -1217,6 +1225,16 @@ void registerOpenTxFirmwares() openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); openTx->addOptions(fai_options); firmwares.push_back(openTx); + + /* Taranis Plus board */ + openTx = new OpenTxFirmware("opentx-taranisplus", QObject::tr("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS, true); + openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support")); + openTx->addOption("notemplates", QObject::tr("Disable TEMPLATES menu")); + openTx->addOption("nogvars", QObject::tr("Disable Global variables")); + openTx->addOption("ppmus", QObject::tr("Channel values displayed in us")); + openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); + openTx->addOptions(fai_options); + firmwares.push_back(openTx); if (g.rev4aSupport()) { openTx = new OpenTxFirmware("opentx-taranisrev4a", QObject::tr("OpenTX for FrSky Taranis Rev4a"), BOARD_TARANIS_REV4a, true); diff --git a/companion/src/generaledit.cpp b/companion/src/generaledit.cpp index 1ec231830..db610616e 100644 --- a/companion/src/generaledit.cpp +++ b/companion/src/generaledit.cpp @@ -278,7 +278,7 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) : ui->serialPortMode->hide(); ui->serialPortLabel->hide(); } - + if (!IS_TARANIS(eepromInterface->getBoard())) { ui->stickReverse1->setChecked(g_eeGeneral.stickReverse & (1 << 0)); ui->stickReverse2->setChecked(g_eeGeneral.stickReverse & (1 << 1)); @@ -296,6 +296,16 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) : ui->stickReverse3->hide(); ui->stickReverse4->hide(); } + + if (IS_TARANIS_PLUS(eepromInterface->getBoard())) { + ui->backlightColor_SL->setValue(g_eeGeneral.backlightColor); + } + else { + ui->backlightColor_label->hide(); + ui->backlightColor_SL->hide(); + ui->backlightColor1_label->hide(); + ui->backlightColor2_label->hide(); + } } GeneralEdit::~GeneralEdit() @@ -506,6 +516,12 @@ void GeneralEdit::on_backlightautoSB_editingFinished() } } +void GeneralEdit::on_backlightColor_SL_valueChanged() +{ + g_eeGeneral.backlightColor = ui->backlightColor_SL->value(); + updateSettings(); +} + void GeneralEdit::on_timezoneSB_editingFinished() { g_eeGeneral.timezone = ui->timezoneSB->value(); diff --git a/companion/src/generaledit.h b/companion/src/generaledit.h index 221ea02d1..f48bb91a0 100644 --- a/companion/src/generaledit.h +++ b/companion/src/generaledit.h @@ -50,6 +50,7 @@ private slots: void on_tabWidget_currentChanged(int index); void on_displayTypeCB_currentIndexChanged(int index); void on_BLBright_SB_editingFinished(); + void on_backlightColor_SL_valueChanged(); void on_re_CB_currentIndexChanged(int index); void on_countrycode_CB_currentIndexChanged(int index); void on_units_CB_currentIndexChanged(int index); diff --git a/companion/src/generaledit.ui b/companion/src/generaledit.ui index 7ec08d04c..410f056e4 100644 --- a/companion/src/generaledit.ui +++ b/companion/src/generaledit.ui @@ -113,31 +113,7 @@ These will be relevant for all models in the same EEPROM. Setup - - - - Haptic Length - - - - - - - If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. - - - - - - - - - - Speaker Pitch (spkr only) - - - - + @@ -166,103 +142,188 @@ These will be relevant for all models in the same EEPROM. - - - - + + + + Speaker Pitch (spkr only) + + + + + + + + + + + + + <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> + + + 0 + + + + R E T A + + + + + R E A T + + + + + R T E A + + + + + R T A E + + + + + R A E T + + + + + R A T E + + + + + E R T A + + + + + E R A T + + + + + E T R A + + + + + E T A R + + + + + E A R T + + + + + E A T R + + + + + T R E A + + + + + T R A E + + + + + T E R A + + + + + T E A R + + + + + T A R E + + + + + T A E R + + + + + A R E T + + + + + A R T E + + + + + A E R T + + + + + A E T R + + + + + A T R E + + + + + A T E R + + + + + + + + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. + + + + + + + + + + - Beep volume + Color 1 - - - - -2 - + + - 2 - - - 1 + 100 Qt::Horizontal - - + + - Wav volume - - - - - - - -2 - - - 2 - - - 1 - - - Qt::Horizontal - - - - - - - Vario volume - - - - - - - -2 - - - 2 - - - 1 - - - Qt::Horizontal - - - - - - - Background volume - - - - - - - -2 - - - 2 - - - 1 - - - Qt::Horizontal + Color 2 - + @@ -292,46 +353,56 @@ These will be relevant for all models in the same EEPROM. - - + + + + + + + + + + Mode selection: + +Mode 1: + Left stick: Elevator, Rudder + Right stick: Throttle, Aileron + +Mode 2: + Left stick: Throttle, Rudder + Right stick: Elevator, Aileron + +Mode 3: + Left stick: Elevator, Aileron + Right stick: Throttle, Rudder + +Mode 4: + Left stick: Throttle, Aileron + Right stick: Elevator, Rudder + + + + + 1 + - 4800 Baud + Mode 1 (RUD ELE THR AIL) - 9600 Baud + Mode 2 (RUD THR ELE AIL) - 14400 Baud + Mode 3 (AIL ELE THR RUD) - 19200 Baud - - - - - 38400 Baud - - - - - 57600 Baud - - - - - 76800 Baud - - - - - 115200 Baud + Mode 4 (AIL THR ELE RUD) @@ -343,21 +414,14 @@ These will be relevant for all models in the same EEPROM. - + Vario pitch at zero - - - - MAVLink Baud Rate - - - - + @@ -371,14 +435,7 @@ These will be relevant for all models in the same EEPROM. - - - - Speaker Volume - - - - + Readonly Unlock @@ -388,7 +445,7 @@ These will be relevant for all models in the same EEPROM. - + Qt::Vertical @@ -408,31 +465,6 @@ These will be relevant for all models in the same EEPROM. - - - - - 0 - 0 - - - - - - - - - - If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. - - - min - - - 120 - - - @@ -496,7 +528,7 @@ These will be relevant for all models in the same EEPROM. - + Qt::Horizontal @@ -516,7 +548,27 @@ These will be relevant for all models in the same EEPROM. - + + + + Stick Mode + + + + + + + + 0 + 0 + + + + Default Channel Order + + + + @@ -530,7 +582,7 @@ These will be relevant for all models in the same EEPROM. - + -14 @@ -596,21 +648,14 @@ These will be relevant for all models in the same EEPROM. - - - - Haptic Strength - - - - + FAI Mode - + @@ -635,39 +680,13 @@ These will be relevant for all models in the same EEPROM. - - - - - 0 - 0 - - - - 23 - - - - + Measurement Units - - - - - 0 - 0 - - - - 5 - - - @@ -702,14 +721,14 @@ p, li { white-space: pre-wrap; } - + Timeshift from UTC - + QLayout::SetMinimumSize @@ -1237,7 +1256,7 @@ p, li { white-space: pre-wrap; } - + Hz @@ -1256,69 +1275,7 @@ p, li { white-space: pre-wrap; } - - - - "No Sound" Warning - - - - - - - Low Memory Warning - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> - - - - - - true - - - - - - - - 0 - 0 - - - - Show Splash Screen on Startup - - - - + @@ -1328,108 +1285,7 @@ p, li { white-space: pre-wrap; } - - - - - - - Contrast - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> - - - - - - true - - - - - - - Inactivity Timer - - - - - - - - Standard - - - - - Optrex - - - - - - - - LCD Display Type - - - - - - - - 0 - 0 - - - - - - - - - - - - - 10 - - - 45 - - - 25 - - - - + @@ -1472,14 +1328,251 @@ Acceptable values are 5v..10v - - + + - BackLight Switch + Vario pitch at max - + + + + + 0 + 0 + + + + + + + + + + If this value is not 0, any keypress will turn on the backlight and turn it off after the specified number of seconds. + + + sec + + + 600 + + + 5 + + + + + + + Hz + + + 1300 + + + 2900 + + + 10 + + + 1700 + + + + + + + ms + + + 200 + + + 1000 + + + 10 + + + 500 + + + + + + + Backlight Brightness + + + + + + + Vario repeat at zero + + + + + + + Backlight Auto OFF after + + + + + + + 100 + + + + + + + + + + RotEnc Navigation + + + + + + + Backlight color + + + + + + + + Standard + + + + + Optrex + + + + + + + + + + + Contrast + + + + + + + + 0 + 0 + + + + + + + + + + If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. + + + min + + + 120 + + + + + + + + 4800 Baud + + + + + 9600 Baud + + + + + 14400 Baud + + + + + 19200 Baud + + + + + 38400 Baud + + + + + 57600 Baud + + + + + 76800 Baud + + + + + 115200 Baud + + + + + + + + Backlight Switch + + + + + + + + 0 + 0 + + + + 23 + + + + + + + + 0 + 0 + + + + Show Splash Screen on Startup + + + + @@ -1497,6 +1590,152 @@ Acceptable values are 5v..10v + + + + LCD Display Type + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> + + + + + + true + + + + + + + MAVLink Baud Rate + + + + + + + + 0 + 0 + + + + + + + + + + + + + 10 + + + 45 + + + 25 + + + + + + + Speaker Volume + + + + + + + Haptic Length + + + + + + + Inactivity Timer + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> + + + + + + true + + + + + + + + 0 + 0 + + + + 5 + + + @@ -1576,326 +1815,122 @@ Acceptable values are 5v..10v - - + + - Vario pitch at max + "No Sound" Warning - - - - - 0 - 0 - - - - - - - - - - If this value is not 0, any keypress will turn on the backlight and turn it off after the specified number of seconds. - - - sec - - - 600 - - - 5 - - - - - - - Hz - - - 1300 - - - 2900 - - - 10 - - - 1700 - - - - - - - ms - - - 200 - - - 1000 - - - 10 - - - 500 - - - - - + + - BackLight Brightness + Low Memory Warning - - + + - Vario repeat at zero + Haptic Strength - - - - BackLight Auto OFF after - - - - - - - 100 - - - - - - - - - - RotEnc Navigation - - - - - - - - 0 - 0 - - - - Default Channel Order - - - - - - - - - - - - - <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> - - - 0 - - - - R E T A - + + + + + + Beep volume + + - - - R E A T - + + + + -2 + + + 2 + + + 1 + + + Qt::Horizontal + + - - - R T E A - + + + + Wav volume + + - - - R T A E - + + + + -2 + + + 2 + + + 1 + + + Qt::Horizontal + + - - - R A E T - + + + + Vario volume + + - - - R A T E - + + + + -2 + + + 2 + + + 1 + + + Qt::Horizontal + + - - - E R T A - + + + + Background volume + + - - - E R A T - + + + + -2 + + + 2 + + + 1 + + + Qt::Horizontal + + - - - E T R A - - - - - E T A R - - - - - E A R T - - - - - E A T R - - - - - T R E A - - - - - T R A E - - - - - T E R A - - - - - T E A R - - - - - T A R E - - - - - T A E R - - - - - A R E T - - - - - A R T E - - - - - A E R T - - - - - A E T R - - - - - A T R E - - - - - A T E R - - - - - - - - - - - - - - Mode selection: - -Mode 1: - Left stick: Elevator, Rudder - Right stick: Throttle, Aileron - -Mode 2: - Left stick: Throttle, Rudder - Right stick: Elevator, Aileron - -Mode 3: - Left stick: Elevator, Aileron - Right stick: Throttle, Rudder - -Mode 4: - Left stick: Throttle, Aileron - Right stick: Elevator, Rudder - - - - - 1 - - - - Mode 1 (RUD ELE THR AIL) - - - - - Mode 2 (RUD THR ELE AIL) - - - - - Mode 3 (AIL ELE THR RUD) - - - - - Mode 4 (AIL THR ELE RUD) - - - - - - - - Stick Mode - - + @@ -3244,6 +3279,7 @@ Mode 4: + channelorderCB trnMode_1 trnChn_1 trnWeight_1 diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index f334b899a..8ce2e41ef 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -161,6 +161,15 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, connect(fswtchParamArmT[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited())); connect(fswtchParamArmT[i], SIGNAL(editTextChanged ( const QString)), this, SLOT(customFunctionEdited())); + + fswtchBLcolor[i] = new QSlider(this); + fswtchBLcolor[i]->setProperty("index", i); + fswtchBLcolor[i]->setMinimum(0); + fswtchBLcolor[i]->setMaximum(100); + fswtchBLcolor[i]->setSingleStep(1); + fswtchBLcolor[i]->setOrientation(Qt::Horizontal); + paramLayout->addWidget(fswtchBLcolor[i]); + connect(fswtchBLcolor[i], SIGNAL(sliderReleased()), this, SLOT(customFunctionEdited())); #ifdef PHONON playBT[i] = new QPushButton(this); @@ -271,6 +280,7 @@ void CustomFunctionsPanel::playMusic() #define CUSTOM_FUNCTION_ENABLE (1<<5) #define CUSTOM_FUNCTION_REPEAT (1<<6) #define CUSTOM_FUNCTION_PLAY (1<<7) +#define CUSTOM_FUNCTION_BL_COLOR (1<<8) void CustomFunctionsPanel::customFunctionEdited() { @@ -453,6 +463,11 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM; } } + else if (index==FuncBacklight && IS_TARANIS_PLUS(GetEepromInterface()->getBoard())) { + if (modified) model.funcSw[i].param = (uint8_t)fswtchBLcolor[i]->value(); + fswtchBLcolor[i]->setValue(model.funcSw[i].param); + widgetsMask |= CUSTOM_FUNCTION_BL_COLOR; + } else { if (modified) model.funcSw[i].param = fswtchParam[i]->value(); fswtchParam[i]->setDecimals(0); @@ -474,6 +489,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) fswtchEnable[i]->setChecked(false); fswtchRepeat[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_REPEAT); fswtchGVmode[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_GV_MODE); + fswtchBLcolor[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_BL_COLOR); #ifdef PHONON playBT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_PLAY); #endif diff --git a/companion/src/modeledit/customfunctions.h b/companion/src/modeledit/customfunctions.h index fecab42a3..40d69cede 100644 --- a/companion/src/modeledit/customfunctions.h +++ b/companion/src/modeledit/customfunctions.h @@ -74,6 +74,7 @@ class CustomFunctionsPanel : public ModelPanel QCheckBox * fswtchEnable[C9X_MAX_CUSTOM_FUNCTIONS]; RepeatComboBox * fswtchRepeat[C9X_MAX_CUSTOM_FUNCTIONS]; QComboBox * fswtchGVmode[C9X_MAX_CUSTOM_FUNCTIONS]; + QSlider * fswtchBLcolor[C9X_MAX_CUSTOM_FUNCTIONS]; #ifdef PHONON Phonon::MediaObject *clickObject; Phonon::AudioOutput *clickOutput; diff --git a/radio/src/Makefile b/radio/src/Makefile index 6c5db764e..2ef55326c 100644 --- a/radio/src/Makefile +++ b/radio/src/Makefile @@ -617,6 +617,9 @@ ifeq ($(PCB), TARANIS) CPPDEFS = -DREV3 else ifeq ($(PCBREV), REV4a) CPPDEFS = -DREV4a + else ifeq ($(PCBREV), REVPLUS) + CPPDEFS = -DREVPLUS + HAPTIC = YES else CPPDEFS = -DREV4 endif diff --git a/radio/src/bootloader/Makefile b/radio/src/bootloader/Makefile index 1e5fa0730..8ebc1362b 100644 --- a/radio/src/bootloader/Makefile +++ b/radio/src/bootloader/Makefile @@ -121,6 +121,8 @@ else CPPDEFS += -DREV3 else ifeq ($(PCBREV), REV4a) CPPDEFS += -DREV4a + else ifeq ($(PCBREV), REVPLUS) + CPPDEFS += -DREVPLUS else CPPDEFS += -DREV4 endif diff --git a/radio/src/gui/menu_general.cpp b/radio/src/gui/menu_general.cpp index 3aab6781f..3cce79fa7 100644 --- a/radio/src/gui/menu_general.cpp +++ b/radio/src/gui/menu_general.cpp @@ -110,33 +110,19 @@ const MenuFuncP_PROGMEM menuTabDiag[] PROGMEM = { #endif #if !defined(CPUM64) - void displaySlider(uint8_t x, uint8_t y, uint8_t value, uint8_t max, uint8_t attr) - { - lcd_putc(RADIO_SETUP_2ND_COLUMN+(value*4*FW)/max, y, '$'); - lcd_hline(RADIO_SETUP_2ND_COLUMN, y+3, 5*FW-1, SOLID); - if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) lcd_filled_rect(RADIO_SETUP_2ND_COLUMN, y, 5*FW-1, FH-1); - } #define SLIDER_5POS(y, value, label, event, attr) { \ int8_t tmp = value; \ displaySlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \ value = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \ } #elif defined(GRAPHICS) - void display5posSlider(uint8_t x, uint8_t y, uint8_t value, uint8_t attr) - { - lcd_putc(RADIO_SETUP_2ND_COLUMN+2*FW+(value*FW), y, '$'); - lcd_hline(RADIO_SETUP_2ND_COLUMN, y+3, 5*FW-1, SOLID); - if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) lcd_filled_rect(RADIO_SETUP_2ND_COLUMN, y, 5*FW-1, FH-1); - } #define SLIDER_5POS(y, value, label, event, attr) { \ int8_t tmp = value; \ display5posSlider(RADIO_SETUP_2ND_COLUMN, y, tmp, attr); \ value = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \ } - #define displaySlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT) #else #define SLIDER_5POS(y, value, label, event, attr) value = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, label, STR_VBEEPLEN, value, -2, +2, attr, event) - #define displaySlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT) #endif #if defined(SPLASH) && !defined(FSPLASH) @@ -180,6 +166,7 @@ enum menuGeneralSetupItems { ITEM_SETUP_BACKLIGHT_MODE, ITEM_SETUP_BACKLIGHT_DELAY, IF_CPUARM(ITEM_SETUP_BRIGHTNESS) + IF_REVPLUS(ITEM_SETUP_BACKLIGHT_COLOR) CASE_PWM_BACKLIGHT(ITEM_SETUP_BACKLIGHT_BRIGHTNESS_OFF) CASE_PWM_BACKLIGHT(ITEM_SETUP_BACKLIGHT_BRIGHTNESS_ON) ITEM_SETUP_FLASH_BEEP, @@ -225,7 +212,7 @@ void menuGeneralSetup(uint8_t event) } #endif - MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) IF_VOICE(0) IF_CPUARM(0) IF_CPUARM(0) IF_CPUARM(0) 0, IF_AUDIO(0) IF_VARIO_CPUARM(LABEL(VARIO)) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) 0, LABEL(ALARMS), 0, CASE_PCBSKY9X(0) CASE_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, IF_CPUARM(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH_PARAM(0) IF_GPS(0) IF_GPS(0) IF_PXX(0) IF_CPUARM(0) IF_CPUARM(0) IF_FAI_CHOICE(0) 0, COL_TX_MODE, CASE_PCBTARANIS(0) 1/*to force edit mode*/}); + MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) IF_VOICE(0) IF_CPUARM(0) IF_CPUARM(0) IF_CPUARM(0) 0, IF_AUDIO(0) IF_VARIO_CPUARM(LABEL(VARIO)) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) 0, LABEL(ALARMS), 0, CASE_PCBSKY9X(0) CASE_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, IF_CPUARM(0) IF_REVPLUS(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH_PARAM(0) IF_GPS(0) IF_GPS(0) IF_PXX(0) IF_CPUARM(0) IF_CPUARM(0) IF_FAI_CHOICE(0) 0, COL_TX_MODE, CASE_PCBTARANIS(0) 1/*to force edit mode*/}); uint8_t sub = m_posVert - 1; @@ -535,6 +522,14 @@ void menuGeneralSetup(uint8_t event) break; #endif +#if defined(PCBTARANIS) && defined(REVPLUS) + case ITEM_SETUP_BACKLIGHT_COLOR: + lcd_putsLeft(y, STR_BLCOLOR); + displaySlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 100, attr); + if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 100, EE_GENERAL | NO_INCDEC_MARKS); + break; +#endif + #if defined(PWM_BACKLIGHT) case ITEM_SETUP_BACKLIGHT_BRIGHTNESS_OFF: lcd_putsLeft(y, STR_BLOFFBRIGHTNESS); @@ -634,21 +629,7 @@ void menuGeneralSetup(uint8_t event) case ITEM_SETUP_STICK_MODE_LABELS: lcd_putsLeft(y, NO_INDENT(STR_MODE)); - for (uint8_t i=0; i<4; i++) { - lcd_img((6+4*i)*FW, y, sticks, i, 0); -#if defined(FRSKY_STICKS) - if (g_eeGeneral.stickReverse & (1< 0 #define ROTARY_ENCODER_NAVIGATION #endif diff --git a/radio/src/targets/taranis/aspi.h b/radio/src/targets/taranis/aspi.h index a3f4f829f..6a17c8391 100644 --- a/radio/src/targets/taranis/aspi.h +++ b/radio/src/targets/taranis/aspi.h @@ -1,6 +1,6 @@ /** ****************************************************************************** - * @file Project/spi/spi.h + * @file Project/spi/spi.h * @author FrSky Application Team * @Hardware version V0.2 * @date 11-July-2012 @@ -19,20 +19,20 @@ extern "C" { #define __no_operation __NOP -#define LCD_NCS_HIGH() GPIO_LCD->BSRRL = PIN_LCD_NCS -#define LCD_NCS_LOW() GPIO_LCD->BSRRH = PIN_LCD_NCS +#define LCD_NCS_HIGH() GPIO_LCD_NCS->BSRRL = PIN_LCD_NCS +#define LCD_NCS_LOW() GPIO_LCD_NCS->BSRRH = PIN_LCD_NCS -#define LCD_A0_HIGH() GPIO_LCD->BSRRL = PIN_LCD_A0 -#define LCD_A0_LOW() GPIO_LCD->BSRRH = PIN_LCD_A0 +#define LCD_A0_HIGH() GPIO_LCD_SPI->BSRRL = PIN_LCD_A0 +#define LCD_A0_LOW() GPIO_LCD_SPI->BSRRH = PIN_LCD_A0 -#define LCD_RST_HIGH() GPIO_LCD->BSRRL = PIN_LCD_RST -#define LCD_RST_LOW() GPIO_LCD->BSRRH = PIN_LCD_RST +#define LCD_RST_HIGH() GPIO_LCD_RST->BSRRL = PIN_LCD_RST +#define LCD_RST_LOW() GPIO_LCD_RST->BSRRH = PIN_LCD_RST -#define LCD_CLK_HIGH() GPIO_LCD->BSRRL = PIN_LCD_CLK -#define LCD_CLK_LOW() GPIO_LCD->BSRRH = PIN_LCD_CLK +#define LCD_CLK_HIGH() GPIO_LCD_SPI->BSRRL = PIN_LCD_CLK +#define LCD_CLK_LOW() GPIO_LCD_SPI->BSRRH = PIN_LCD_CLK -#define LCD_MOSI_HIGH() GPIO_LCD->BSRRL = PIN_LCD_MOSI -#define LCD_MOSI_LOW() GPIO_LCD->BSRRH = PIN_LCD_MOSI +#define LCD_MOSI_HIGH() GPIO_LCD_SPI->BSRRL = PIN_LCD_MOSI +#define LCD_MOSI_LOW() GPIO_LCD_SPI->BSRRH = PIN_LCD_MOSI void AspiCmd(u8 Command_Byte); void AspiData(u8 Para_data); diff --git a/radio/src/targets/taranis/board_taranis.cpp b/radio/src/targets/taranis/board_taranis.cpp index dca639737..5efac5549 100644 --- a/radio/src/targets/taranis/board_taranis.cpp +++ b/radio/src/targets/taranis/board_taranis.cpp @@ -171,4 +171,16 @@ void boardInit() } #endif +#if defined(REVPLUS) +void turnBacklightOn(uint8_t level, uint8_t color) +{ + TIM4->CCR4 = (100-level)*color; + TIM4->CCR2 = (100-level)*(100-color); +} +void turnBacklightOff(void) +{ + TIM4->CCR4 = 0; + TIM4->CCR2 = 0; +} +#endif diff --git a/radio/src/targets/taranis/board_taranis.h b/radio/src/targets/taranis/board_taranis.h index 889d6c4dc..5fd7d7bd6 100644 --- a/radio/src/targets/taranis/board_taranis.h +++ b/radio/src/targets/taranis/board_taranis.h @@ -143,8 +143,8 @@ void delay_01us(uint16_t nb); // Flash Write driver #define FLASH_PAGESIZE 256 -void unlockFlash(); -void lockFlash(); +void unlockFlash(void); +void lockFlash(void); void writeFlash(uint32_t * address, uint32_t * buffer); uint32_t isFirmwareStart(const void * buffer); uint32_t isBootloaderStart(const void * buffer); @@ -203,16 +203,25 @@ void pwrInit(void); uint32_t pwrCheck(void); void pwrOff(void); #define UNEXPECTED_SHUTDOWN() (g_eeGeneral.unexpectedShutdown) -#define INTERNAL_RF_ON() GPIO_SetBits(GPIOPWR, PIN_INT_RF_PWR) -#define INTERNAL_RF_OFF() GPIO_ResetBits(GPIOPWR, PIN_INT_RF_PWR) -#define EXTERNAL_RF_ON() GPIO_SetBits(GPIOPWR, PIN_EXT_RF_PWR) -#define EXTERNAL_RF_OFF() GPIO_ResetBits(GPIOPWR, PIN_EXT_RF_PWR) +#define INTERNAL_RF_ON() GPIO_SetBits(GPIO_INT_RF_PWR, PIN_INT_RF_PWR) +#define INTERNAL_RF_OFF() GPIO_ResetBits(GPIO_INT_RF_PWR, PIN_INT_RF_PWR) +#define EXTERNAL_RF_ON() GPIO_SetBits(GPIO_EXT_RF_PWR, PIN_EXT_RF_PWR) +#define EXTERNAL_RF_OFF() GPIO_ResetBits(GPIO_EXT_RF_PWR, PIN_EXT_RF_PWR) // Backlight driver -#define setBacklight(xx) TIM10->CCR1 = 100-xx -#define __BACKLIGHT_ON TIM10->CCR1 = 100-g_eeGeneral.backlightBright -#define __BACKLIGHT_OFF TIM10->CCR1 = 0 -#define IS_BACKLIGHT_ON() (TIM10->CCR1 != 0) +#if defined(REVPLUS) +void turnBacklightOn(uint8_t level, uint8_t color); +void turnBacklightOff(void); + #define setBacklight(xx) turnBacklightOn(xx, g_eeGeneral.backlightColor) + #define __BACKLIGHT_ON turnBacklightOn(g_eeGeneral.backlightBright, g_eeGeneral.backlightColor) + #define __BACKLIGHT_OFF turnBacklightOff() + #define IS_BACKLIGHT_ON() (TIM4->CCR4 != 0) || (TIM4->CCR2 != 0) +#else + #define setBacklight(xx) TIM10->CCR1 = 100-xx + #define __BACKLIGHT_ON TIM10->CCR1 = 100-g_eeGeneral.backlightBright + #define __BACKLIGHT_OFF TIM10->CCR1 = 0 + #define IS_BACKLIGHT_ON() (TIM10->CCR1 != 0) +#endif // USB driver #define BOOTLOADER_REQUEST() (0) diff --git a/radio/src/targets/taranis/hal.h b/radio/src/targets/taranis/hal.h index ef6bfa74b..082e725c5 100644 --- a/radio/src/targets/taranis/hal.h +++ b/radio/src/targets/taranis/hal.h @@ -14,10 +14,10 @@ #define GPIO_BUTTON_MENU GPIOD->IDR #define GPIO_BUTTON_EXIT GPIOD->IDR #define GPIO_BUTTON_PAGE GPIOD->IDR -#define PIN_BUTTON_PLUS GPIO_Pin_10 //SW3 PE.10 +#define PIN_BUTTON_PLUS GPIO_Pin_10 //SW3 PE.10 #define PIN_BUTTON_MINUS GPIO_Pin_11 //SW1 PE.12 -#define PIN_BUTTON_ENTER GPIO_Pin_12 //SW2 PE.11 -#define PIN_BUTTON_MENU GPIO_Pin_7 //SW4 PD.07 +#define PIN_BUTTON_ENTER GPIO_Pin_12 //SW2 PE.11 +#define PIN_BUTTON_MENU GPIO_Pin_7 //SW4 PD.07 #define PIN_BUTTON_PAGE GPIO_Pin_3 //SW6 PD.02 #define PIN_BUTTON_EXIT GPIO_Pin_2 //SW5 PD.03 @@ -30,12 +30,12 @@ #define GPIO_TRIM_LV_UP GPIOE->IDR #define GPIO_TRIM_RV_DN GPIOC->IDR #define GPIO_TRIM_RH_R GPIOC->IDR -#define PIN_TRIM_RV_DN GPIO_Pin_3 //PC.03 -#define PIN_TRIM_RV_UP GPIO_Pin_2 //PC.02 -#define PIN_TRIM_RH_L GPIO_Pin_1 //PC.01 -#define PIN_TRIM_RH_R GPIO_Pin_13 //PC.13 +#define PIN_TRIM_RV_DN GPIO_Pin_3 //PC.03 +#define PIN_TRIM_RV_UP GPIO_Pin_2 //PC.02 +#define PIN_TRIM_RH_L GPIO_Pin_1 //PC.01 +#define PIN_TRIM_RH_R GPIO_Pin_13 //PC.13 #if defined(REV3) - #define PIN_TRIM_LH_R GPIO_Pin_4 //PE.04 + #define PIN_TRIM_LH_R GPIO_Pin_4 //PE.04 #define PIN_TRIM_LH_L GPIO_Pin_3 //PE.03 #else #define PIN_TRIM_LH_L GPIO_Pin_4 //PE.04 @@ -47,7 +47,7 @@ // Switchs #if defined(REV3) #define GPIO_PIN_SW_F (~GPIOE->IDR) - #define PIN_SW_F GPIO_Pin_14 //PE.14 + #define PIN_SW_F GPIO_Pin_14 //PE.14 #else #define GPIO_PIN_SW_F GPIOE->IDR #define PIN_SW_F GPIO_Pin_14 //PE.14 @@ -55,8 +55,8 @@ #define GPIO_PIN_SW_E_L GPIOB->IDR #define GPIO_PIN_SW_E_H GPIOB->IDR -#define PIN_SW_E_L GPIO_Pin_3 //PB.03 -#define PIN_SW_E_H GPIO_Pin_4 //PB.04 +#define PIN_SW_E_L GPIO_Pin_3 //PB.03 +#define PIN_SW_E_H GPIO_Pin_4 //PB.04 #if defined(REV3) #define GPIO_PIN_SW_B_L GPIOB->IDR @@ -73,8 +73,8 @@ #if defined(REV3) #define GPIO_PIN_SW_A_H (~GPIOB->IDR) #define GPIO_PIN_SW_A_L (~GPIOE->IDR) - #define PIN_SW_A_H GPIO_Pin_7 //PB.07 - #define PIN_SW_A_L GPIO_Pin_2 //PE.02 + #define PIN_SW_A_H GPIO_Pin_7 //PB.07 + #define PIN_SW_A_L GPIO_Pin_2 //PE.02 #else #define GPIO_PIN_SW_A_H GPIOB->IDR #define GPIO_PIN_SW_A_L GPIOE->IDR @@ -86,7 +86,7 @@ #define GPIO_PIN_SW_G_H (~GPIOA->IDR) #define GPIO_PIN_SW_G_L (~GPIOB->IDR) #define PIN_SW_G_H GPIO_Pin_5 //PA.05 - #define PIN_SW_G_L GPIO_Pin_0 //PB.00 + #define PIN_SW_G_L GPIO_Pin_0 //PB.00 #else #define GPIO_PIN_SW_G_H GPIOE->IDR #define GPIO_PIN_SW_G_L GPIOE->IDR @@ -98,7 +98,7 @@ #define GPIO_PIN_SW_C_H (~GPIOB->IDR) #define GPIO_PIN_SW_C_L (~GPIOE->IDR) #define PIN_SW_C_H GPIO_Pin_1 //PB.01 - #define PIN_SW_C_L GPIO_Pin_7 //PE.07 + #define PIN_SW_C_L GPIO_Pin_7 //PE.07 #else #define GPIO_PIN_SW_C_H GPIOE->IDR #define GPIO_PIN_SW_C_L GPIOA->IDR @@ -109,8 +109,13 @@ #if defined(REV3) #define GPIO_PIN_SW_D_H (~GPIOE->IDR) #define GPIO_PIN_SW_D_L (~GPIOE->IDR) - #define PIN_SW_D_H GPIO_Pin_9 //PE.09 - #define PIN_SW_D_L GPIO_Pin_8 //PE.08 + #define PIN_SW_D_H GPIO_Pin_9 //PE.09 + #define PIN_SW_D_L GPIO_Pin_8 //PE.08 +#elif defined(REVPLUS) + #define GPIO_PIN_SW_D_H (GPIOE->IDR) + #define GPIO_PIN_SW_D_L (GPIOE->IDR) + #define PIN_SW_D_H GPIO_Pin_7 //PE.07 + #define PIN_SW_D_L GPIO_Pin_13 //PE.13 #else #define GPIO_PIN_SW_D_H GPIOE->IDR #define GPIO_PIN_SW_D_L GPIOB->IDR @@ -121,6 +126,9 @@ #if defined(REV3) #define GPIO_PIN_SW_H (~GPIOE->IDR) #define PIN_SW_H GPIO_Pin_13 //PE.13 +#elif defined(REVPLUS) + #define GPIO_PIN_SW_H GPIOD->IDR + #define PIN_SW_H GPIO_Pin_14 //PD.14 #else #define GPIO_PIN_SW_H GPIOE->IDR #define PIN_SW_H GPIO_Pin_13 //PE.13 @@ -139,6 +147,9 @@ #else #define PIN_FLP_J2 GPIO_Pin_0 //PB.00 #endif +#if defined(REVPLUS) + #define PIN_FLP_J3 GPIO_Pin_1 //PB.01 +#endif #define PIN_MVOLT GPIO_Pin_0 //PC.00 #if defined(REV3) #define RCC_AHB1Periph_GPIOADC RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC @@ -156,8 +167,15 @@ #define RCC_AHB1Periph_GPIOPWR RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD #define GPIOPWRLED GPIOC #define GPIOPWR GPIOD -#define PIN_INT_RF_PWR GPIO_Pin_15 +#define GPIO_EXT_RF_PWR GPIOD #define PIN_EXT_RF_PWR GPIO_Pin_8 +#if defined(REVPLUS) + #define GPIO_INT_RF_PWR GPIOC + #define PIN_INT_RF_PWR GPIO_Pin_6 +#else + #define GPIO_INT_RF_PWR GPIOD + #define PIN_INT_RF_PWR GPIO_Pin_15 +#endif // Trainer Port #define GPIO_TR_INOUT GPIOC @@ -219,20 +237,46 @@ #define PIN_FS_DM GPIO_Pin_11 //PA.11 #define PIN_FS_DP GPIO_Pin_12 //PA.12 -// BackLight PB8 -#define RCC_AHB1Periph_GPIOBL RCC_AHB1Periph_GPIOB -#define GPIO_Pin_BL GPIO_Pin_8 //PB.08 -#define GPIOBL GPIOB -#define GPIO_PinSource_BL GPIO_PinSource8 +// BackLight +#if defined (REVPLUS) + #define RCC_AHB1Periph_GPIOBL RCC_AHB1Periph_GPIOD + #define GPIO_Pin_BL GPIO_Pin_15 //PD.15 + #define Pin_BL_AF GPIO_AF_TIM4 + #define GPIOBL GPIOD + #define GPIO_PinSource_BL GPIO_PinSource15 + #define GPIO_Pin_BLW GPIO_Pin_13 //PD.13 + #define Pin_BLW_AF GPIO_AF_TIM4 + #define GPIO_PinSource_BLW GPIO_PinSource13 +#else + #define RCC_AHB1Periph_GPIOBL RCC_AHB1Periph_GPIOB + #define GPIO_Pin_BL GPIO_Pin_8 //PB.08 + #define Pin_BL_AF GPIO_AF_TIM10 + #define GPIOBL GPIOB + #define GPIO_PinSource_BL GPIO_PinSource8 +#endif -// LCD GPIOD 10-14 -#define RCC_AHB1Periph_LCD RCC_AHB1Periph_GPIOD -#define GPIO_LCD GPIOD -#define PIN_LCD_MOSI GPIO_Pin_10 //PD.10 -#define PIN_LCD_CLK GPIO_Pin_11 //PD.11 -#define PIN_LCD_NCS GPIO_Pin_14 //PD.14 -#define PIN_LCD_A0 GPIO_Pin_13 //PD.13 -#define PIN_LCD_RST GPIO_Pin_12 //pd12 test //RESET occurs when powered up,but should delay before initialize +// LCD +#if defined(REVPLUS) + #define RCC_AHB1Periph_LCD RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD + #define GPIO_LCD_SPI GPIOC + #define GPIO_LCD_NCS GPIOA + #define GPIO_LCD_RST GPIOD + #define PIN_LCD_MOSI GPIO_Pin_12 //PC.12 + #define PIN_LCD_CLK GPIO_Pin_10 //PC.10 + #define PIN_LCD_NCS GPIO_Pin_15 //PA.15 + #define PIN_LCD_A0 GPIO_Pin_11 //PC.11 + #define PIN_LCD_RST GPIO_Pin_12 //PD.12 +#else + #define RCC_AHB1Periph_LCD RCC_AHB1Periph_GPIOD + #define GPIO_LCD_SPI GPIOD + #define GPIO_LCD_NCS GPIOD + #define GPIO_LCD_RST GPIOD + #define PIN_LCD_MOSI GPIO_Pin_10 //PD.10 + #define PIN_LCD_CLK GPIO_Pin_11 //PD.11 + #define PIN_LCD_NCS GPIO_Pin_14 //PD.14 + #define PIN_LCD_A0 GPIO_Pin_13 //PD.13 + #define PIN_LCD_RST GPIO_Pin_12 //PD.12 +#endif // Audio - I2S3 #define CODEC_I2S SPI3 @@ -296,13 +340,13 @@ #define RCC_AHB1Periph_GPIO_SD RCC_AHB1Periph_GPIOB #define RCC_APBPeriphClockCmd_SPI_SD RCC_APB1PeriphClockCmd #define RCC_APBPeriph_SPI_SD RCC_APB1Periph_SPI2 -#define RCC_AHB1Periph_DMA_SD RCC_AHB1Periph_DMA1 -#define SPI_BaudRatePrescaler_SPI_SD SPI_BaudRatePrescaler_4 //10.5<20MHZ,make sure < 20MHZ +#define RCC_AHB1Periph_DMA_SD RCC_AHB1Periph_DMA1 +#define SPI_BaudRatePrescaler_SPI_SD SPI_BaudRatePrescaler_4 //10.5<20MHZ,make sure < 20MHZ //disabled io_ctl and cp/wp -#define CARD_SUPPLY_SWITCHABLE 0 -#define SOCKET_WP_CONNECTED 0 -#define SOCKET_CP_CONNECTED 0 +#define CARD_SUPPLY_SWITCHABLE 0 +#define SOCKET_WP_CONNECTED 0 +#define SOCKET_CP_CONNECTED 0 /* set to 1 to provide a disk_ioctrl function even if not needed by the FatFs */ #define STM32_SD_DISK_IOCTRL_FORCE 0 @@ -312,13 +356,13 @@ #endif #ifdef STM32_SD_USE_DMA -#define DMA_Channel_SPI_SD_RX DMA1_Stream3 -#define DMA_Channel_SPI_SD_TX DMA1_Stream4 +#define DMA_Channel_SPI_SD_RX DMA1_Stream3 +#define DMA_Channel_SPI_SD_TX DMA1_Stream4 -#define DMA_FLAG_SPI_SD_TC_RX DMA_FLAG_TCIF3 -#define DMA_FLAG_SPI_SD_TC_TX DMA_FLAG_TCIF4 -#define DMA_Channel_SPI2_TX DMA_Channel_0 -#define DMA_Channel_SPI2_RX DMA_Channel_0 +#define DMA_FLAG_SPI_SD_TC_RX DMA_FLAG_TCIF3 +#define DMA_FLAG_SPI_SD_TC_TX DMA_FLAG_TCIF4 +#define DMA_Channel_SPI2_TX DMA_Channel_0 +#define DMA_Channel_SPI2_RX DMA_Channel_0 #endif // Audio----I2S3-----SPI3 @@ -336,6 +380,7 @@ // Haptic #if defined(REVPLUS) #define RCC_AHB1Periph_GPIOHAPTIC RCC_AHB1Periph_GPIOB + #define GPIO_PinSource_HAPTIC GPIO_PinSource8 #define GPIO_HAPTIC GPIOB #define PIN_HAPTIC GPIO_Pin_8 #else diff --git a/radio/src/targets/taranis/haptic_driver.cpp b/radio/src/targets/taranis/haptic_driver.cpp index c3b910995..c6df245cd 100644 --- a/radio/src/targets/taranis/haptic_driver.cpp +++ b/radio/src/targets/taranis/haptic_driver.cpp @@ -39,7 +39,7 @@ void hapticOff(void) { #if defined(REVPLUS) - return; // TODO PWM support + TIM10->CCR1 = 0; #else GPIO_ResetBits(GPIO_HAPTIC, PIN_HAPTIC); #endif @@ -48,8 +48,10 @@ void hapticOff(void) #if defined(REVPLUS) void hapticOn(uint32_t pwmPercent) { - // pwmPercent 0-100 - return; // TODO PWM support + if (pwmPercent > 100) { + pwmPercent = 100; + } + TIM10->CCR1 = pwmPercent; } #else void hapticOn() @@ -61,14 +63,24 @@ void hapticOn() void hapticInit(void) { - GPIO_InitTypeDef GPIO_InitStructure; RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOHAPTIC, ENABLE); - - /* GPIO Configuration*/ + GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Pin = PIN_HAPTIC; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIO_HAPTIC, &GPIO_InitStructure); + + GPIO_PinAFConfig(GPIO_HAPTIC, GPIO_PinSource_HAPTIC, GPIO_AF_TIM10); + + RCC->APB2ENR |= RCC_APB2ENR_TIM10EN ; // Enable clock + TIM10->ARR = 100 ; + TIM10->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 10000 - 1; + TIM10->CCMR1 = TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2 ; // PWM + TIM10->CCER = TIM_CCER_CC1E ; + + TIM10->CCR1 = 0 ; + TIM10->EGR = 0 ; + TIM10->CR1 = TIM_CR1_CEN ; // Counter enable } diff --git a/radio/src/targets/taranis/keys_driver.cpp b/radio/src/targets/taranis/keys_driver.cpp index d8e97524b..58673786d 100644 --- a/radio/src/targets/taranis/keys_driver.cpp +++ b/radio/src/targets/taranis/keys_driver.cpp @@ -230,14 +230,17 @@ bool switchState(EnumKeys enuk) void keysInit() { GPIO_InitTypeDef GPIO_InitStructure; - /* GPIOC GPIOD clock enable */ + RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOBUTTON, ENABLE); - /* GPIO Configuration*/ #if defined(REV3) GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_PLUS | PIN_BUTTON_ENTER | PIN_BUTTON_MINUS | PIN_TRIM_LH_R | PIN_TRIM_LH_L | PIN_TRIM_LV_DN | PIN_TRIM_LV_UP | PIN_SW_A_L | PIN_SW_D_L | PIN_SW_F | PIN_SW_C_L | PIN_SW_D_H | PIN_SW_H; +#elif defined(REVPLUS) + GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_PLUS | PIN_BUTTON_ENTER | PIN_BUTTON_MINUS | PIN_TRIM_LH_R | PIN_TRIM_LH_L + | PIN_TRIM_LV_DN | PIN_TRIM_LV_UP + | PIN_SW_F | PIN_SW_A_L | PIN_SW_B_H | PIN_SW_B_L | PIN_SW_C_H | PIN_SW_D_H | PIN_SW_D_L | PIN_SW_G_H | PIN_SW_G_L; #else GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_PLUS | PIN_BUTTON_ENTER | PIN_BUTTON_MINUS | PIN_TRIM_LH_R | PIN_TRIM_LH_L | PIN_TRIM_LV_DN | PIN_TRIM_LV_UP @@ -249,29 +252,23 @@ void keysInit() GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ; GPIO_Init(GPIOE, &GPIO_InitStructure); +#if defined(REVPLUS) + GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_MENU | PIN_BUTTON_EXIT | PIN_BUTTON_PAGE | PIN_SW_H; +#else GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_MENU | PIN_BUTTON_EXIT | PIN_BUTTON_PAGE; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; - GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; - GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ; +#endif GPIO_Init(GPIOD, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = PIN_TRIM_RV_DN | PIN_TRIM_RV_UP | PIN_TRIM_RH_L | PIN_TRIM_RH_R; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; - GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; - GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ; GPIO_Init(GPIOC, &GPIO_InitStructure); #if defined(REV3) GPIO_InitStructure.GPIO_Pin = PIN_SW_B_H | PIN_SW_B_L | PIN_SW_C_H | PIN_SW_E_L | PIN_SW_E_H | PIN_SW_A_H | PIN_SW_G_L; +#elif defined(REVPLUS) + GPIO_InitStructure.GPIO_Pin = PIN_SW_E_L | PIN_SW_E_H | PIN_SW_A_H; #else GPIO_InitStructure.GPIO_Pin = PIN_SW_E_L | PIN_SW_E_H | PIN_SW_A_H | PIN_SW_D_L; #endif - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; - GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; - GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ; GPIO_Init(GPIOB, &GPIO_InitStructure); #if defined(REV3) @@ -279,10 +276,6 @@ void keysInit() #else GPIO_InitStructure.GPIO_Pin = PIN_SW_C_L; #endif - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; - GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; - GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ; GPIO_Init(GPIOA, &GPIO_InitStructure); } #endif diff --git a/radio/src/targets/taranis/lcd_driver.cpp b/radio/src/targets/taranis/lcd_driver.cpp index e9e3c1129..48ce626f7 100644 --- a/radio/src/targets/taranis/lcd_driver.cpp +++ b/radio/src/targets/taranis/lcd_driver.cpp @@ -98,12 +98,12 @@ const uint8_t lcdPalette[4] = { 0, 0x03, 0x06, 0x0F }; #define LCD_WRITE_BIT(bit) \ if (bit) \ - GPIOD->BSRRL = PIN_LCD_MOSI; \ + LCD_MOSI_HIGH(); \ else \ - GPIOD->BSRRH = PIN_LCD_MOSI; \ - GPIOD->BSRRH = PIN_LCD_CLK; /* Clock low */ \ + LCD_MOSI_LOW(); \ + LCD_CLK_LOW(); \ __no_operation(); \ - GPIOD->BSRRL = PIN_LCD_CLK; /* Clock high */ + LCD_CLK_HIGH(); void lcdRefresh() { @@ -137,24 +137,45 @@ static void LCD_BL_Config() { RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOBL, ENABLE); GPIO_InitTypeDef GPIO_InitStructure; - GPIO_InitStructure.GPIO_Pin =GPIO_Pin_BL; + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_BL; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOBL, &GPIO_InitStructure); + GPIO_PinAFConfig(GPIOBL, GPIO_PinSource_BL, Pin_BL_AF); - GPIO_PinAFConfig(GPIOBL, GPIO_PinSource_BL, GPIO_AF_TIM10); +#if defined(REVPLUS) + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_BLW; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; + GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; + GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; + GPIO_Init(GPIOBL, &GPIO_InitStructure); + GPIO_PinAFConfig(GPIOBL, GPIO_PinSource_BLW, Pin_BLW_AF); + + RCC->APB1ENR |= RCC_APB1ENR_TIM4EN ; // Enable clock + TIM4->ARR = 100 ; + TIM4->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 10000 - 1; + TIM4->CCMR1 = TIM_CCMR1_OC2M_1 | TIM_CCMR1_OC2M_2 ; // PWM + TIM4->CCMR2 = TIM_CCMR2_OC4M_1 | TIM_CCMR2_OC4M_2 ; // PWM + TIM4->CCER = TIM_CCER_CC4E | TIM_CCER_CC2E ; + int BacklightBrightness = 40 ; + TIM4->CCR2 = BacklightBrightness ; + TIM4->CCR4 = BacklightBrightness ; + TIM4->EGR = 0 ; + TIM4->CR1 = TIM_CR1_CEN ; // Counter enable +#else RCC->APB2ENR |= RCC_APB2ENR_TIM10EN ; // Enable clock TIM10->ARR = 100 ; TIM10->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 10000 - 1; TIM10->CCMR1 = 0x60 ; // PWM TIM10->CCER = 1 ; - TIM10->CCR1 = 80; TIM10->EGR = 0 ; TIM10->CR1 = 1 ; +#endif } /** Init the anolog spi gpio @@ -166,21 +187,26 @@ static void LCD_Hardware_Init() GPIO_InitTypeDef GPIO_InitStructure; /*!< Configure lcd CLK\ MOSI\ A0pin in output pushpull mode *************/ - GPIO_InitStructure.GPIO_Pin =PIN_LCD_MOSI | PIN_LCD_CLK | PIN_LCD_A0; + GPIO_InitStructure.GPIO_Pin = PIN_LCD_MOSI | PIN_LCD_CLK | PIN_LCD_A0; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; - GPIO_Init(GPIO_LCD, &GPIO_InitStructure); + GPIO_Init(GPIO_LCD_SPI, &GPIO_InitStructure); + LCD_NCS_HIGH(); + /*!< Configure lcd NCS pin in output pushpull mode ,PULLUP *************/ - GPIO_InitStructure.GPIO_Pin = PIN_LCD_NCS |PIN_LCD_RST; + GPIO_InitStructure.GPIO_Pin = PIN_LCD_NCS; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; + GPIO_Init(GPIO_LCD_NCS, &GPIO_InitStructure); - GPIO_Init(GPIO_LCD, &GPIO_InitStructure); + /*!< Configure lcd RST pin in output pushpull mode ,PULLUP *************/ + GPIO_InitStructure.GPIO_Pin = PIN_LCD_RST; + GPIO_Init(GPIO_LCD_RST, &GPIO_InitStructure); } //275us diff --git a/radio/src/targets/taranis/pwr_driver.c b/radio/src/targets/taranis/pwr_driver.c index 2df7d5d2b..d896a2ab6 100644 --- a/radio/src/targets/taranis/pwr_driver.c +++ b/radio/src/targets/taranis/pwr_driver.c @@ -66,13 +66,21 @@ void pwrInit() GPIO_Init(GPIOPWRLED, &GPIO_InitStructure); #if !defined(REV3) - GPIO_ResetBits(GPIOPWR, PIN_INT_RF_PWR | PIN_EXT_RF_PWR); - GPIO_InitStructure.GPIO_Pin = PIN_INT_RF_PWR | PIN_EXT_RF_PWR; + GPIO_ResetBits(GPIO_INT_RF_PWR, PIN_INT_RF_PWR); + GPIO_InitStructure.GPIO_Pin = PIN_INT_RF_PWR; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; - GPIO_Init(GPIOPWR, &GPIO_InitStructure); + GPIO_Init(GPIO_INT_RF_PWR, &GPIO_InitStructure); + + GPIO_ResetBits(GPIO_EXT_RF_PWR, PIN_EXT_RF_PWR); + GPIO_InitStructure.GPIO_Pin = PIN_EXT_RF_PWR; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; + GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; + GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; + GPIO_Init(GPIO_EXT_RF_PWR, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = PIN_TRNDET; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 0fa37e668..09e3794c5 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -469,6 +469,7 @@ const pm_char STR_FLASH_BOOTLOADER[] PROGMEM = TR_FLASH_BOOTLOADER; const pm_char STR_WRITING[] PROGMEM = TR_WRITING; const pm_char STR_CONFIRM_FORMAT[] PROGMEM = TR_CONFIRM_FORMAT; const pm_char STR_EEBACKUP[] PROGMEM = TR_EEBACKUP; +const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR; #if LCD_W >= 212 const pm_char STR_MODELNAME[] PROGMEM = TR_MODELNAME; diff --git a/radio/src/translations.h b/radio/src/translations.h index 69207f82d..7b1d68638 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -619,7 +619,8 @@ extern const pm_char STR_VIEW_TEXT[]; extern const pm_char STR_FLASH_BOOTLOADER[]; extern const pm_char STR_WRITING[]; extern const pm_char STR_CONFIRM_FORMAT[]; -extern const pm_char STR_EEBACKUP[]; +extern const pm_char STR_EEBACKUP[]; +extern const pm_char STR_BLCOLOR[]; #if defined(VOICE) && defined(CPUARM) struct LanguagePack { diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 75b93cf6a..ce8f9b6f7 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -546,6 +546,7 @@ #define TR_BLDELAY INDENT"Zhasnout po" #define TR_BLONBRIGHTNESS INDENT"Jas Zap." #define TR_BLOFFBRIGHTNESS INDENT"Jas Vyp." +#define TR_BLCOLOR INDENT "Color" #define TR_SPLASHSCREEN TR("úvodníLogo", "Zobrazit úvodní logo") #define TR_THROTTLEWARNING TR("* Plyn", INDENT "Páka Plynu") #define TR_SWITCHWARNING TR("* Spínače", INDENT "Polohy Spínačů") diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index c42ff513d..95aa29ca3 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -550,6 +550,7 @@ #define TR_BLDELAY INDENT"Dauer" #define TR_BLONBRIGHTNESS INDENT"An Helligkeit" #define TR_BLOFFBRIGHTNESS INDENT"Aus Helligkeit" +#define TR_BLCOLOR INDENT "Color" #define TR_SPLASHSCREEN "Startbild Ein für" #define TR_THROTTLEWARNING TR("Gas Alarm", INDENT "Gas Alarm") #define TR_SWITCHWARNING TR("Sch. Alarm", INDENT "Schalter Alarm") diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 407aaa5d0..02efdf188 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -52,7 +52,7 @@ #define TR_NCHANNELS "\0014CH\0016CH\0018CH10CH12CH14CH16CH" #define LEN_VBEEPMODE "\005" -#define TR_VBEEPMODE "Quiet""Alarm""NoKey""All " +#define TR_VBEEPMODE "Quiet""Alarm""NoKey""All\0 " #define LEN_VBEEPLEN "\005" #define TR_VBEEPLEN "0====""=0===""==0==""===0=""====0" @@ -550,6 +550,7 @@ #define TR_BLDELAY INDENT "Duration" #define TR_BLONBRIGHTNESS INDENT "ON Brightness" #define TR_BLOFFBRIGHTNESS INDENT "OFF Brightness" +#define TR_BLCOLOR INDENT "Color" #define TR_SPLASHSCREEN "Splash screen" #define TR_THROTTLEWARNING TR("T-Warning", INDENT "Throttle State") #define TR_SWITCHWARNING TR("S-Warning", INDENT "Switch Positions") diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index ccef208d5..cda817d82 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -546,6 +546,7 @@ #define TR_BLDELAY INDENT"Duracion" #define TR_BLONBRIGHTNESS INDENT"MAS Brillo" #define TR_BLOFFBRIGHTNESS INDENT"MENOS Brillo" +#define TR_BLCOLOR INDENT "Color" #define TR_SPLASHSCREEN "Ptalla.inicio" #define TR_THROTTLEWARNING TR("Aviso-A", INDENT "Aviso Acelerador") #define TR_SWITCHWARNING TR("Aviso-I", INDENT "Aviso Intrptor") diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 8760491c0..1b50a167b 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -546,6 +546,7 @@ #define TR_BLDELAY INDENT"Duration" #define TR_BLONBRIGHTNESS INDENT"ON Brightness" #define TR_BLOFFBRIGHTNESS INDENT"OFF Brightness" +#define TR_BLCOLOR INDENT "Color" #define TR_SPLASHSCREEN "Splash screen" #define TR_THROTTLEWARNING TR("T-Warning", INDENT "Throttle Warning") #define TR_SWITCHWARNING TR("S-Warning", INDENT "Switch Warning") diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index f35f472eb..b4e65e4dd 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -550,6 +550,7 @@ #define TR_BLDELAY INDENT "Durée" #define TR_BLONBRIGHTNESS INDENT "Luminosité ON" #define TR_BLOFFBRIGHTNESS INDENT "Luminosité OFF" +#define TR_BLCOLOR INDENT "Couleur" #define TR_SPLASHSCREEN "Logo d'accueil" #define TR_THROTTLEWARNING TR("Alerte gaz", INDENT "Alerte gaz") #define TR_SWITCHWARNING TR("Alerte int", INDENT "Pos. interrupteurs") diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 3c6aa3606..d03a1e1a4 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -546,6 +546,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_BLCOLOR INDENT "Color" #define TR_SPLASHSCREEN TR("Schermo avvio", "Schermata di avvio") #define TR_THROTTLEWARNING TR("All. Thr", INDENT "Allarme Throttle") #define TR_SWITCHWARNING TR("Avv. Int.", INDENT "Avviso Interr.") diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 0f2d7d4f9..20bad9f4a 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -546,6 +546,7 @@ #define TR_BLDELAY INDENT"Czas trwania" #define TR_BLONBRIGHTNESS INDENT"Jasnośc wł." #define TR_BLOFFBRIGHTNESS INDENT"Jasność wył." +#define TR_BLCOLOR INDENT "Color" #define TR_SPLASHSCREEN "Logo ekranu" #define TR_THROTTLEWARNING TR("(\043)Gaz", INDENT "(\043)Gaz") #define TR_SWITCHWARNING TR("(\043)Przełącznik", INDENT "(\043)Przełącznik") diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index c0e14452c..1a173b0ae 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -546,6 +546,7 @@ #define TR_BLDELAY INDENT"Tempo Backlight" #define TR_BLONBRIGHTNESS INDENT"ON Brightness" #define TR_BLOFFBRIGHTNESS INDENT"OFF Brightness" +#define TR_BLCOLOR INDENT "Color" #define TR_SPLASHSCREEN "Splash screen" #define TR_THROTTLEWARNING TR("Avisa Acel", INDENT "Avisa Acel") #define TR_SWITCHWARNING TR("Avisa Chav", INDENT "Avisa Chav") diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 1f68577ce..5edd503cf 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -551,6 +551,7 @@ #define TR_BLONBRIGHTNESS INDENT"På Ljusstyrka" #define TR_BLOFFBRIGHTNESS INDENT"Av Ljusstyrka" #define TR_SPLASHSCREEN "Startbild" +#define TR_BLCOLOR INDENT "Color" #define TR_THROTTLEWARNING TR("Gasvarning", INDENT "Gasvarning") #define TR_SWITCHWARNING TR("Bryt.varn.", INDENT "Brytarvarning") #define TR_POTWARNING TR("Rattvarn.", INDENT "Rattvarning") @@ -878,4 +879,4 @@ #define TR_VIEW_CHANNELS "Visa Kanaler" #define TR_VIEW_NOTES "Visa Noteringars" #define TR_MODS_FORBIDDEN "Modifikationer förbjudna!" -#define TR_UNLOCKED "Olåst" \ No newline at end of file +#define TR_UNLOCKED "Olåst"