Issue #660 - Firmware part done. I need to check the ASM because when
compiled with the FRSKY_STICKS option enabled, the FW is lighter than without the option!
This commit is contained in:
@@ -470,6 +470,7 @@ class GeneralSettings {
|
||||
int PPM_Multiplier;
|
||||
int hapticLength;
|
||||
unsigned int reNavigation;
|
||||
unsigned int stickReverse;
|
||||
bool hideNameOnSplash;
|
||||
bool enablePpmsim;
|
||||
unsigned int speakerPitch;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -215,7 +215,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
if (renumber==0) {
|
||||
ui->re_label->hide();
|
||||
ui->re_CB->hide();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
populateRotEncCB(ui->re_CB, g_eeGeneral.reNavigation, renumber);
|
||||
}
|
||||
ui->contrastSB->setValue(g_eeGeneral.contrast);
|
||||
|
||||
+5
-6
@@ -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
|
||||
@@ -791,8 +790,8 @@ ifeq ($(AUTOSOURCE), YES)
|
||||
CPPDEFS += -DAUTOSOURCE
|
||||
endif
|
||||
|
||||
ifeq ($(TARANIS_STICKS), YES)
|
||||
CPPDEFS += -DTARANIS_STICKS
|
||||
ifeq ($(FRSKY_STICKS), YES)
|
||||
CPPDEFS += -DFRSKY_STICKS
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
+14
-1
@@ -363,6 +363,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;
|
||||
@@ -395,7 +407,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;
|
||||
|
||||
@@ -2820,8 +2820,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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user