Merge remote-tracking branch 'origin/TaranisPlus' into next
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#define LUA_MODEL_SCRIPTS
|
||||
#define EEPROM_VARIANT 3
|
||||
#define HAPTIC
|
||||
#define REVPLUS
|
||||
|
||||
#define NUM_POTS 5
|
||||
|
||||
|
||||
@@ -707,7 +707,7 @@ class FlightModeField: public TransformedField {
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
internalField.Append(new SignedField<2>(trimExt[i]));
|
||||
}
|
||||
else if (board == BOARD_TARANIS && version >= 216) {
|
||||
else if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
internalField.Append(new SignedField<11>(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<NUM_STICKS; i++) {
|
||||
if (board == BOARD_TARANIS && version >= 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<NUM_STICKS; i++) {
|
||||
if (board == BOARD_TARANIS && version >= 216) {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
if (trimMode[i] == TRIM_MODE_NONE) {
|
||||
phase.trimMode[i] = -1;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
+721
-685
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user