Fixes #2056 - Needs tests!
This commit is contained in:
@@ -90,7 +90,9 @@ enum menuGeneralSetupItems {
|
||||
CASE_REVPLUS(ITEM_SETUP_BACKLIGHT_COLOR)
|
||||
ITEM_SETUP_FLASH_BEEP,
|
||||
CASE_SPLASH_PARAM(ITEM_SETUP_DISABLE_SPLASH)
|
||||
CASE_GPS(ITEM_SETUP_LABEL_GPS)
|
||||
CASE_GPS(ITEM_SETUP_TIMEZONE)
|
||||
CASE_GPS(ITEM_SETUP_ADJUST_RTC)
|
||||
CASE_GPS(ITEM_SETUP_GPSFORMAT)
|
||||
CASE_PXX(ITEM_SETUP_COUNTRYCODE)
|
||||
ITEM_SETUP_LANGUAGE,
|
||||
@@ -126,7 +128,7 @@ void menuGeneralSetup(uint8_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, { 2, 2, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO_CPUARM(LABEL(VARIO)) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_REVPLUS(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ });
|
||||
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, { 2, 2, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO_CPUARM(LABEL(VARIO)) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_REVPLUS(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(LABEL(GPS)) CASE_GPS(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ });
|
||||
|
||||
int sub = m_posVert;
|
||||
|
||||
@@ -412,12 +414,20 @@ void menuGeneralSetup(uint8_t event)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY) && defined(FRSKY_HUB) && defined(GPS)
|
||||
case ITEM_SETUP_LABEL_GPS:
|
||||
lcd_putsLeft(y, STR_GPS);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_TIMEZONE:
|
||||
lcd_putsLeft(y, STR_TIMEZONE);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.timezone, -12, 12);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_ADJUST_RTC:
|
||||
g_eeGeneral.adjustRTC = onoffMenuItem(g_eeGeneral.adjustRTC, RADIO_SETUP_2ND_COLUMN, y, STR_ADJUST_RTC, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_GPSFORMAT:
|
||||
g_eeGeneral.gpsFormat = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
|
||||
break;
|
||||
|
||||
@@ -742,7 +742,7 @@ PACK(typedef struct {
|
||||
uint8_t disableAlarmWarning:1;
|
||||
uint8_t stickMode:2;
|
||||
int8_t timezone:5;
|
||||
uint8_t spare1:1;
|
||||
uint8_t adjustRTC:1;
|
||||
uint8_t inactivityTimer;
|
||||
uint8_t mavbaud:3;
|
||||
SPLASH_MODE; /* 3bits */
|
||||
|
||||
@@ -53,12 +53,28 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t newVal, uin
|
||||
datetime.month = (uint8_t) ((data & 0x00ff0000) >> 16);
|
||||
datetime.day = (uint8_t) ((data & 0x0000ff00) >> 8);
|
||||
datetime.datestate = 1;
|
||||
if (g_eeGeneral.adjustRTC) {
|
||||
struct gtm t;
|
||||
gettime(&t);
|
||||
t.tm_year = datetime.year-1900;
|
||||
t.tm_mon = datetime.month;
|
||||
t.tm_mday = datetime.day;
|
||||
rtcSetTime(&t);
|
||||
}
|
||||
}
|
||||
else {
|
||||
datetime.hour = ((uint8_t) ((data & 0xff000000) >> 24) + g_eeGeneral.timezone + 24) % 24;
|
||||
datetime.min = (uint8_t) ((data & 0x00ff0000) >> 16);
|
||||
datetime.sec = (uint16_t) ((data & 0x0000ff00) >> 8);
|
||||
datetime.timestate = 1;
|
||||
if (g_eeGeneral.adjustRTC) {
|
||||
struct gtm t;
|
||||
gettime(&t);
|
||||
t.tm_hour = datetime.hour;
|
||||
t.tm_min = datetime.min;
|
||||
t.tm_sec = datetime.sec;
|
||||
rtcSetTime(&t);
|
||||
}
|
||||
}
|
||||
if (datetime.year == 0) {
|
||||
return;
|
||||
|
||||
@@ -248,6 +248,8 @@ const pm_char STR_THROTTLEWARNING[] PROGMEM = TR_THROTTLEWARNING;
|
||||
const pm_char STR_SWITCHWARNING[] PROGMEM = TR_SWITCHWARNING;
|
||||
#ifdef FRSKY
|
||||
const pm_char STR_TIMEZONE[] PROGMEM = TR_TIMEZONE;
|
||||
const pm_char STR_ADJUST_RTC[] PROGMEM = TR_ADJUST_RTC;
|
||||
const pm_char STR_GPS[] PROGMEM = TR_GPS;
|
||||
const pm_char STR_GPSCOORD[] PROGMEM = TR_GPSCOORD;
|
||||
const pm_char STR_VARIO[] PROGMEM = TR_VARIO;
|
||||
const pm_char STR_PITCH_AT_ZERO[] PROGMEM = TR_PITCH_AT_ZERO;
|
||||
|
||||
@@ -427,6 +427,8 @@ extern const pm_char STR_SPLASHSCREEN[];
|
||||
extern const pm_char STR_THROTTLEWARNING[];
|
||||
extern const pm_char STR_SWITCHWARNING[];
|
||||
extern const pm_char STR_TIMEZONE[];
|
||||
extern const pm_char STR_ADJUST_RTC[];
|
||||
extern const pm_char STR_GPS[];
|
||||
extern const pm_char STR_GPSCOORD[];
|
||||
extern const pm_char STR_VARIO[];
|
||||
extern const pm_char STR_PITCH_AT_ZERO[];
|
||||
|
||||
@@ -621,6 +621,8 @@
|
||||
#define TR_SWITCHWARNING TR("* Spínače", INDENT "Polohy Spínačů")
|
||||
#define TR_POTWARNING TR("* Potenc.", INDENT "Nastavení Pot.")
|
||||
#define TR_TIMEZONE "časové pásmo"
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD TR("Pořadí kanálů", "Výchozí pořadí kanálů")
|
||||
#define TR_STICKS "Sticks"
|
||||
#define TR_POTS "Pots"
|
||||
|
||||
@@ -669,6 +669,8 @@
|
||||
#define TR_SWITCHWARNING TR("Sch. Alarm", INDENT "Schalter-Alarm")
|
||||
#define TR_POTWARNING TR("Pot Warn.", INDENT "Poti-Warnung")
|
||||
#define TR_TIMEZONE TR("Zeitzone", "GPS-Zeitzone +/-Std")
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD TR("Kanalanordnung", "Kanalvoreinstellung")
|
||||
#define TR_STICKS "Knüppel"
|
||||
#define TR_POTS "Potis"
|
||||
|
||||
@@ -668,7 +668,9 @@
|
||||
#define TR_THROTTLEWARNING TR(IF_CPUARM(INDENT) "T-Warning", INDENT "Throttle State")
|
||||
#define TR_SWITCHWARNING TR(IF_CPUARM(INDENT) "S-Warning", INDENT "Switch Positions")
|
||||
#define TR_POTWARNING TR(IF_CPUARM(INDENT) "Pot Warn.", INDENT "Pot Positions")
|
||||
#define TR_TIMEZONE TR("Time Zone", "GPS Time zone")
|
||||
#define TR_TIMEZONE TR("Time Zone", INDENT "Time zone")
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD TR("Rx Channel Ord", "Default channel order")
|
||||
#define TR_STICKS "Sticks"
|
||||
#define TR_POTS "Pots"
|
||||
@@ -771,7 +773,7 @@
|
||||
#define TR_MINRSSI "Min Rssi"
|
||||
#define TR_LATITUDE "Latitude"
|
||||
#define TR_LONGITUDE "Longitude"
|
||||
#define TR_GPSCOORD TR("GPS Coords", "GPS coordinate format")
|
||||
#define TR_GPSCOORD TR("GPS Coords", INDENT "Coordinate format")
|
||||
#define TR_VARIO TR("Vario", "Variometer")
|
||||
#define TR_PITCH_AT_ZERO INDENT "Pitch at Zero"
|
||||
#define TR_PITCH_AT_MAX INDENT "Pitch at Max"
|
||||
|
||||
@@ -618,6 +618,8 @@
|
||||
#define TR_SWITCHWARNING TR("Aviso-I", INDENT "Aviso Intrptor")
|
||||
#define TR_POTWARNING TR("Pot Warn.", INDENT "Pot Warning")
|
||||
#define TR_TIMEZONE TR("Zona Hora", "GPS Zona Hora")
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD TR("Rx Orden canal", "Orden habitual canales")
|
||||
#define TR_STICKS "Sticks"
|
||||
#define TR_POTS "Pots"
|
||||
|
||||
@@ -618,6 +618,8 @@
|
||||
#define TR_SWITCHWARNING TR("S-Warning", INDENT "Switch Warning")
|
||||
#define TR_POTWARNING TR("Pot Warn.", INDENT "Pot Warning")
|
||||
#define TR_TIMEZONE TR("Time Zone","GPS Time zone")
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD TR("Rx Channel Ord","Default channel order")
|
||||
#define TR_STICKS "Sticks"
|
||||
#define TR_POTS "Pots"
|
||||
|
||||
@@ -673,6 +673,8 @@
|
||||
#define TR_SWITCHWARNING TR(IF_CPUARM(INDENT) "Alerte int", INDENT "Pos. interrupteurs")
|
||||
#define TR_POTWARNING TR(IF_CPUARM(INDENT) "Alerte pot", INDENT "Pos. potentios")
|
||||
#define TR_TIMEZONE "Fuseau horaire"
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD TR("Ordre voies RX","Ordre des voies préféré")
|
||||
#define TR_STICKS "Manches"
|
||||
#define TR_POTS "Potentios"
|
||||
|
||||
@@ -618,6 +618,8 @@
|
||||
#define TR_SWITCHWARNING TR("Avv. Int.", INDENT "Avviso Interr.")
|
||||
#define TR_POTWARNING TR("Avv. Pot.", INDENT "Avviso Pot.")
|
||||
#define TR_TIMEZONE "Ora locale"
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD "Ordine ch RX"
|
||||
#define TR_STICKS "Sticks"
|
||||
#define TR_POTS "Pots"
|
||||
|
||||
@@ -616,6 +616,8 @@
|
||||
#define TR_SWITCHWARNING TR(IF_CPUARM(INDENT) "OstrzPrzeł", INDENT "PozycjaPrzeł")
|
||||
#define TR_POTWARNING TR(IF_CPUARM(INDENT) "Ostrz.Poten.", INDENT "PozycjaPotencj.")
|
||||
#define TR_TIMEZONE TR("Strefa czasowa" ,"Strefa czasowa GPS")
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD TR("KolejnKan.RX", "Bazowa kolejność kanałów")
|
||||
#define TR_STICKS "Sticks"
|
||||
#define TR_POTS "Pots"
|
||||
|
||||
@@ -618,6 +618,8 @@
|
||||
#define TR_SWITCHWARNING TR("Avisa Chav", INDENT "Avisa Chav")
|
||||
#define TR_POTWARNING TR("Pot Warn.", INDENT "Pot Warning")
|
||||
#define TR_TIMEZONE "Time Zone"
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD "Ordem Canal RX"
|
||||
#define TR_STICKS "Sticks"
|
||||
#define TR_POTS "Pots"
|
||||
|
||||
@@ -618,6 +618,8 @@
|
||||
#define TR_SWITCHWARNING TR("Bryt.varn.", INDENT "Brytarvarning")
|
||||
#define TR_POTWARNING TR("Rattvarn.", INDENT "Rattvarning")
|
||||
#define TR_TIMEZONE TR("Tidszon", "GPS Tidszon")
|
||||
#define TR_ADJUST_RTC INDENT "Adjust RTC"
|
||||
#define TR_GPS "GPS"
|
||||
#define TR_RXCHANNELORD "Kanaler i RX"
|
||||
#define TR_STICKS "Sticks"
|
||||
#define TR_POTS "Pots"
|
||||
|
||||
Reference in New Issue
Block a user