1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 16:55:20 +03:00

Merge branch 'bsongis/Issue660' into next

Conflicts:
	companion/src/firmwares/opentx/opentxinterface.cpp
This commit is contained in:
Andre Bernet 2014-05-02 14:44:24 +02:00
commit 1a43b6d353
15 changed files with 458 additions and 337 deletions

View file

@ -486,6 +486,7 @@ class GeneralSettings {
int PPM_Multiplier;
int hapticLength;
unsigned int reNavigation;
unsigned int stickReverse;
bool hideNameOnSplash;
bool enablePpmsim;
unsigned int speakerPitch;

View file

@ -47,6 +47,7 @@
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define EEPROM_VARIANT 3

View file

@ -45,6 +45,7 @@
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define EEPROM_VARIANT SIMU_M128_VARIANTS
#define GAUGES

View file

@ -53,6 +53,7 @@
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define NUM_POTS 3
#define EEPROM_VARIANT 3

View file

@ -2639,7 +2639,15 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new UnsignedField<8>(generalData.templateSetup));
internalField.Append(new SignedField<8>(generalData.PPM_Multiplier));
internalField.Append(new SignedField<8>(generalData.hapticLength));
internalField.Append(new UnsignedField<8>(generalData.reNavigation));
if (version < 216 || !IS_9X(board)) {
internalField.Append(new UnsignedField<8>(generalData.reNavigation));
}
if (version >= 216 && !IS_TARANIS(board)) {
internalField.Append(new UnsignedField<4>(generalData.stickReverse));
internalField.Append(new SpareBitsField<4>());
}
internalField.Append(new SignedField<3>(generalData.beeperLength));
internalField.Append(new UnsignedField<3>(generalData.hapticStrength));

View file

@ -1051,6 +1051,7 @@ void registerOpenTxFirmwares()
openTx->addOption("nogps", QObject::tr("No GPS support"));
openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
openTx->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors"));
openTx->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
openTx->addOptions(fai_options);
firmwares.push_back(openTx);
@ -1117,6 +1118,7 @@ void registerOpenTxFirmwares()
openTx->addOption("novario", QObject::tr("No vario support"));
openTx->addOption("nogps", QObject::tr("No GPS support"));
openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
openTx->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
openTx->addOptions(fai_options);
firmwares.push_back(openTx);

View file

@ -49,6 +49,7 @@
#define GAUGES
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
#define GAUGES

View file

@ -278,6 +278,24 @@ 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));
ui->stickReverse3->setChecked(g_eeGeneral.stickReverse & (1 << 2));
ui->stickReverse4->setChecked(g_eeGeneral.stickReverse & (1 << 3));
connect(ui->stickReverse1, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited()));
connect(ui->stickReverse2, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited()));
connect(ui->stickReverse3, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited()));
connect(ui->stickReverse4, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited()));
}
else {
ui->stickReverseLB->hide();
ui->stickReverse1->hide();
ui->stickReverse2->hide();
ui->stickReverse3->hide();
ui->stickReverse4->hide();
}
}
GeneralEdit::~GeneralEdit()
@ -285,6 +303,12 @@ GeneralEdit::~GeneralEdit()
delete ui;
}
void GeneralEdit::stickReverseEdited()
{
g_eeGeneral.stickReverse = ((int)ui->stickReverse1->isChecked()) | ((int)ui->stickReverse2->isChecked()<<1) | ((int)ui->stickReverse3->isChecked()<<2) | ((int)ui->stickReverse4->isChecked()<<3);
updateSettings();
}
void GeneralEdit::on_pot1Type_currentIndexChanged(int index)
{
g_eeGeneral.potsType[0] = index;

View file

@ -130,6 +130,7 @@ private slots:
void unlockSwitchEdited();
void setValues();
void shrink();
void stickReverseEdited();
};
#endif // GENERALEDIT_H

View file

@ -113,134 +113,6 @@ These will be relevant for all models in the same EEPROM.</string>
<string>Setup</string>
</attribute>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0,0,0">
<item row="26" column="3" colspan="2">
<layout class="QHBoxLayout" name="pxxCountry">
<item>
<widget class="QLabel" name="countrycode_label">
<property name="text">
<string>Country Code</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="countrycode_CB">
<item>
<property name="text">
<string>America</string>
</property>
</item>
<item>
<property name="text">
<string>Japan</string>
</property>
</item>
<item>
<property name="text">
<string>Europe</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="29" column="1">
<widget class="QComboBox" name="stickmodeCB">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string>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
</string>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>Mode 1 (RUD ELE THR AIL)</string>
</property>
</item>
<item>
<property name="text">
<string>Mode 2 (RUD THR ELE AIL)</string>
</property>
</item>
<item>
<property name="text">
<string>Mode 3 (AIL ELE THR RUD)</string>
</property>
</item>
<item>
<property name="text">
<string>Mode 4 (AIL THR ELE RUD)</string>
</property>
</item>
</widget>
</item>
<item row="23" column="1">
<widget class="QComboBox" name="mavbaud_CB">
<item>
<property name="text">
<string>4800 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>9600 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>14400 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>19200 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>38400 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>57600 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>76800 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>115200 Baud</string>
</property>
</item>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_HL">
<property name="text">
@ -248,6 +120,52 @@ Mode 4:
</property>
</widget>
</item>
<item row="26" column="1">
<widget class="QCheckBox" name="faimode_CB">
<property name="toolTip">
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_speakerPitch">
<property name="text">
<string>Speaker Pitch (spkr only)</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QComboBox" name="hapticLengthCB">
<item>
<property name="text">
<string>X-Short</string>
</property>
</item>
<item>
<property name="text">
<string>Short</string>
</property>
</item>
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Long</string>
</property>
</item>
<item>
<property name="text">
<string>X-Long</string>
</property>
</item>
</widget>
</item>
<item row="3" column="3" rowspan="2" colspan="2">
<layout class="QGridLayout" name="gridLayout_9" columnstretch="1,0,1,0">
<item row="0" column="0">
@ -344,6 +262,80 @@ Mode 4:
</item>
</layout>
</item>
<item row="26" column="3" colspan="2">
<layout class="QHBoxLayout" name="pxxCountry">
<item>
<widget class="QLabel" name="countrycode_label">
<property name="text">
<string>Country Code</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="countrycode_CB">
<item>
<property name="text">
<string>America</string>
</property>
</item>
<item>
<property name="text">
<string>Japan</string>
</property>
</item>
<item>
<property name="text">
<string>Europe</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="23" column="1">
<widget class="QComboBox" name="mavbaud_CB">
<item>
<property name="text">
<string>4800 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>9600 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>14400 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>19200 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>38400 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>57600 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>76800 Baud</string>
</property>
</item>
<item>
<property name="text">
<string>115200 Baud</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_beeperlen">
<property name="text">
@ -396,7 +388,7 @@ Mode 4:
</property>
</widget>
</item>
<item row="30" column="0" colspan="2">
<item row="32" column="0" colspan="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -524,15 +516,8 @@ Mode 4:
</property>
</widget>
</item>
<item row="29" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Stick Mode</string>
</property>
</widget>
</item>
<item row="29" column="3">
<widget class="QLabel" name="label_13">
<item row="31" column="3">
<widget class="QLabel" name="stickReverseLB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
@ -540,7 +525,7 @@ Mode 4:
</sizepolicy>
</property>
<property name="text">
<string>Default Channel Order</string>
<string>Stick reverse</string>
</property>
</widget>
</item>
@ -638,188 +623,6 @@ Mode 4:
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QComboBox" name="hapticLengthCB">
<item>
<property name="text">
<string>X-Short</string>
</property>
</item>
<item>
<property name="text">
<string>Short</string>
</property>
</item>
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Long</string>
</property>
</item>
<item>
<property name="text">
<string>X-Long</string>
</property>
</item>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_speakerPitch">
<property name="text">
<string>Speaker Pitch (spkr only)</string>
</property>
</widget>
</item>
<item row="29" column="4">
<widget class="QComboBox" name="channelorderCB">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Channel order&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Defines the order of the default mixes created on a new model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>R E T A</string>
</property>
</item>
<item>
<property name="text">
<string>R E A T</string>
</property>
</item>
<item>
<property name="text">
<string>R T E A</string>
</property>
</item>
<item>
<property name="text">
<string>R T A E</string>
</property>
</item>
<item>
<property name="text">
<string>R A E T</string>
</property>
</item>
<item>
<property name="text">
<string>R A T E</string>
</property>
</item>
<item>
<property name="text">
<string>E R T A</string>
</property>
</item>
<item>
<property name="text">
<string>E R A T</string>
</property>
</item>
<item>
<property name="text">
<string>E T R A</string>
</property>
</item>
<item>
<property name="text">
<string>E T A R</string>
</property>
</item>
<item>
<property name="text">
<string>E A R T</string>
</property>
</item>
<item>
<property name="text">
<string>E A T R</string>
</property>
</item>
<item>
<property name="text">
<string>T R E A</string>
</property>
</item>
<item>
<property name="text">
<string>T R A E</string>
</property>
</item>
<item>
<property name="text">
<string>T E R A</string>
</property>
</item>
<item>
<property name="text">
<string>T E A R</string>
</property>
</item>
<item>
<property name="text">
<string>T A R E</string>
</property>
</item>
<item>
<property name="text">
<string>T A E R</string>
</property>
</item>
<item>
<property name="text">
<string>A R E T</string>
</property>
</item>
<item>
<property name="text">
<string>A R T E</string>
</property>
</item>
<item>
<property name="text">
<string>A E R T</string>
</property>
</item>
<item>
<property name="text">
<string>A E T R</string>
</property>
</item>
<item>
<property name="text">
<string>A T R E</string>
</property>
</item>
<item>
<property name="text">
<string>A T E R</string>
</property>
</item>
</widget>
</item>
<item row="26" column="1">
<widget class="QCheckBox" name="faimode_CB">
<property name="toolTip">
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="28" column="3" colspan="2">
<layout class="QHBoxLayout" name="gpsFormatLayout">
<item>
@ -1897,6 +1700,248 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="29" column="3">
<widget class="QLabel" name="label_19">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Default Channel Order</string>
</property>
</widget>
</item>
<item row="29" column="4">
<widget class="QComboBox" name="channelorderCB">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Channel order&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Defines the order of the default mixes created on a new model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>R E T A</string>
</property>
</item>
<item>
<property name="text">
<string>R E A T</string>
</property>
</item>
<item>
<property name="text">
<string>R T E A</string>
</property>
</item>
<item>
<property name="text">
<string>R T A E</string>
</property>
</item>
<item>
<property name="text">
<string>R A E T</string>
</property>
</item>
<item>
<property name="text">
<string>R A T E</string>
</property>
</item>
<item>
<property name="text">
<string>E R T A</string>
</property>
</item>
<item>
<property name="text">
<string>E R A T</string>
</property>
</item>
<item>
<property name="text">
<string>E T R A</string>
</property>
</item>
<item>
<property name="text">
<string>E T A R</string>
</property>
</item>
<item>
<property name="text">
<string>E A R T</string>
</property>
</item>
<item>
<property name="text">
<string>E A T R</string>
</property>
</item>
<item>
<property name="text">
<string>T R E A</string>
</property>
</item>
<item>
<property name="text">
<string>T R A E</string>
</property>
</item>
<item>
<property name="text">
<string>T E R A</string>
</property>
</item>
<item>
<property name="text">
<string>T E A R</string>
</property>
</item>
<item>
<property name="text">
<string>T A R E</string>
</property>
</item>
<item>
<property name="text">
<string>T A E R</string>
</property>
</item>
<item>
<property name="text">
<string>A R E T</string>
</property>
</item>
<item>
<property name="text">
<string>A R T E</string>
</property>
</item>
<item>
<property name="text">
<string>A E R T</string>
</property>
</item>
<item>
<property name="text">
<string>A E T R</string>
</property>
</item>
<item>
<property name="text">
<string>A T R E</string>
</property>
</item>
<item>
<property name="text">
<string>A T E R</string>
</property>
</item>
</widget>
</item>
<item row="31" column="4">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="stickReverse1">
<property name="text">
<string notr="true">1</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stickReverse2">
<property name="text">
<string notr="true">2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stickReverse3">
<property name="text">
<string notr="true">3</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stickReverse4">
<property name="text">
<string notr="true">4</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="29" column="1">
<widget class="QComboBox" name="stickmodeCB">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string>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
</string>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>Mode 1 (RUD ELE THR AIL)</string>
</property>
</item>
<item>
<property name="text">
<string>Mode 2 (RUD THR ELE AIL)</string>
</property>
</item>
<item>
<property name="text">
<string>Mode 3 (AIL ELE THR RUD)</string>
</property>
</item>
<item>
<property name="text">
<string>Mode 4 (AIL THR ELE RUD)</string>
</property>
</item>
</widget>
</item>
<item row="29" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Stick Mode</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabTrainer">
@ -3199,7 +3244,6 @@ Acceptable values are 5v..10v</string>
</layout>
</widget>
<tabstops>
<tabstop>channelorderCB</tabstop>
<tabstop>trnMode_1</tabstop>
<tabstop>trnChn_1</tabstop>
<tabstop>trnWeight_1</tabstop>

View file

@ -97,10 +97,9 @@ NAVIGATION = NO
# Values = YES, NO
AUTOSWITCH = NO
# Swap Stick Inputs for AIL,ELE,RUD,THR
# Used in some scenarios where stick/pot entries
# cannot be changed by soldering the pots.
# Stock sticks replaced by FrSky ones
# Values = YES, NO
FRSKY_STICKS = NO
# Sources automatic selection
# Values = YES, NO
@ -803,8 +802,8 @@ ifeq ($(AUTOSOURCE), YES)
CPPDEFS += -DAUTOSOURCE
endif
ifeq ($(TARANIS_STICKS), YES)
CPPDEFS += -DTARANIS_STICKS
ifeq ($(FRSKY_STICKS), YES)
CPPDEFS += -DFRSKY_STICKS
endif

View file

@ -197,6 +197,12 @@ enum menuGeneralSetupItems {
ITEM_SETUP_MAX
};
#if defined(FRSKY_STICKS)
#define COL_TX_MODE 0
#else
#define COL_TX_MODE LABEL(TX_MODE)
#endif
void menuGeneralSetup(uint8_t event)
{
#if defined(RTCLOCK)
@ -219,7 +225,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, LABEL(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) 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;
@ -628,7 +634,21 @@ 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);
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<<i)) {
lcd_filled_rect((6+4*i)*FW, y, 3*FW, FH-1);
}
#endif
}
#if defined(FRSKY_STICKS)
if (attr) {
s_editMode = 0;
CHECK_INCDEC_GENVAR(event, g_eeGeneral.stickReverse, 0, 15);
lcd_rect(6*FW-1, y-1, 15*FW+2, 9);
}
#endif
break;
case ITEM_SETUP_STICK_MODE:

View file

@ -364,6 +364,18 @@ PACK(typedef struct {
int16_t spanPos;
}) CalibData;
#if defined(PCBSTD)
#define N_PCBSTD_FIELD(x)
#else
#define N_PCBSTD_FIELD(x) x;
#endif
#if defined(PCBTARANIS)
#define N_TARANIS_FIELD(x)
#else
#define N_TARANIS_FIELD(x) x;
#endif
#define ALTERNATE_VIEW 0x10
PACK(typedef struct t_EEGeneral {
uint8_t version;
@ -396,7 +408,8 @@ PACK(typedef struct t_EEGeneral {
uint8_t templateSetup; // RETA order for receiver channels
int8_t PPM_Multiplier;
int8_t hapticLength;
uint8_t reNavigation; // not used on STOCK board
N_PCBSTD_FIELD( uint8_t reNavigation)
N_TARANIS_FIELD(uint8_t stickReverse)
int8_t beepLength:3;
uint8_t hapticStrength:3;
uint8_t gpsFormat:1;

View file

@ -2827,8 +2827,13 @@ uint16_t anaIn(uint8_t chan)
return *p;
#else
static const pm_char crossAna[] PROGMEM = {3,1,2,0,4,5,6,7};
volatile uint16_t *p = &s_anaFilt[pgm_read_byte(crossAna+chan)];
return *p;
uint16_t temp = s_anaFilt[pgm_read_byte(crossAna+chan)];
#if defined(FRSKY_STICKS)
if (chan < NUM_STICKS && (g_eeGeneral.stickReverse & (1 << chan))) {
temp = 2048 - temp;
}
#endif
return temp;
#endif
}

View file

@ -38,7 +38,7 @@
volatile uint16_t Analog_values[NUMBER_ANALOG];
#if defined(TARANIS_STICKS)
#if defined(FRSKY_STICKS)
const char ana_direction[NUMBER_ANALOG] = {1, 1, 0, 1 ,0 ,1 ,0, 0, 0};
#endif
@ -118,12 +118,12 @@ void adcRead()
}
// adc direction correct
#if defined(TARANIS_STICKS)
#if defined(FRSKY_STICKS)
uint32_t i ;
for (i=0; i<NUMBER_ANALOG; i++) {
if (ana_direction[i]) {
Analog_values[i] = 4096-Analog_values[i];
}
}
#endif
#endif
}