diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index 56514109a..91da15e51 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -479,6 +479,7 @@ class GeneralSettings { int backgroundVolume; unsigned int mavbaud; unsigned int switchUnlockStates; + unsigned int hw_uartMode; }; class CurveReference { diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index a6bb2e0de..fb8cf5203 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -2110,6 +2110,9 @@ Open9xGeneralDataNew::Open9xGeneralDataNew(GeneralSettings & generalData, BoardE internalField.Append(new SignedField<8>(generalData.varioVolume)); internalField.Append(new SignedField<8>(generalData.backgroundVolume)); } + if (version >= 216) { + internalField.Append(new UnsignedField<8>(generalData.hw_uartMode)); + } } } diff --git a/radio/src/gui/menu_general.cpp b/radio/src/gui/menu_general.cpp index e1b799e0b..ba165de4c 100644 --- a/radio/src/gui/menu_general.cpp +++ b/radio/src/gui/menu_general.cpp @@ -75,7 +75,7 @@ enum EnumTabDiag { e_Vers, e_Keys, e_Ana, - IF_PCBSKY9X(e_Hardware) + IF_CPUARM(e_Hardware) e_Calib }; @@ -95,7 +95,7 @@ const MenuFuncP_PROGMEM menuTabDiag[] PROGMEM = { menuGeneralVersion, menuGeneralDiagKeys, menuGeneralDiagAna, - IF_PCBSKY9X(menuGeneralHardware) + IF_CPUARM(menuGeneralHardware) menuGeneralCalib }; @@ -1166,7 +1166,33 @@ void menuGeneralDiagAna(uint8_t event) #endif } -#if defined(PCBSKY9X) +#if defined(PCBTARANIS) +enum menuGeneralHwItems { + ITEM_SETUP_HW_UART3_MODE, + ITEM_SETUP_HW_MAX +}; + +#define HW_SETTINGS_COLUMN 15*FW + +void menuGeneralHardware(uint8_t event) +{ + MENU(STR_HARDWARE, menuTabDiag, e_Hardware, ITEM_SETUP_HW_MAX+1, {0}); + + uint8_t sub = m_posVert - 1; + + for (uint8_t i=0; i0) ? BLINK|INVERS : INVERS) : 0); + switch(i) { + case ITEM_SETUP_HW_UART3_MODE: + g_eeGeneral.hw_uartMode = selectMenuItem(HW_SETTINGS_COLUMN, y, STR_UART3MODE, STR_UART3MODES, g_eeGeneral.hw_uartMode, 0, 2, attr, event); + break; + } + } + +} + +#elif defined(PCBSKY9X) enum menuGeneralHwItems { ITEM_SETUP_HW_OPTREX_DISPLAY, ITEM_SETUP_HW_STICKS_GAINS_LABELS, diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 64d168787..f06ef0ef6 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -239,7 +239,8 @@ enum BeeperMode { int8_t beepVolume; \ int8_t wavVolume; \ int8_t varioVolume; \ - int8_t backgroundVolume; + int8_t backgroundVolume; \ + uint8_t hw_uartMode; #elif defined(PXX) #define EXTRA_GENERAL_FIELDS uint8_t countryCode; #else diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 079f76e79..842ec8090 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -55,6 +55,9 @@ const pm_char STR_OPEN9X[] PROGMEM = #endif ISTR(TRNMODE) ISTR(TRNCHN) +#if defined(PCBTARANIS) + ISTR(UART3MODES) +#endif ISTR(VTRIMINC) ISTR(RETA123) ISTR(VPROTOS) @@ -491,6 +494,7 @@ const pm_char STR_VIEW_TEXT[] PROGMEM = "View text"; const pm_char STR_SCALE[] PROGMEM = "Scale"; const pm_char STR_VIEW_CHANNELS[] PROGMEM = "View Channels"; const pm_char STR_VIEW_NOTES[] PROGMEM = "View Notes"; + const pm_char STR_UART3MODE[] PROGMEM = TR_UART3MODE; #endif #if MENUS_LOCK == 1 diff --git a/radio/src/translations.h b/radio/src/translations.h index 5a68e0e9e..d83e3c753 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -99,7 +99,12 @@ extern const pm_char STR_OPEN9X[]; #define OFS_TRNMODE (OFS_VBEEPMODE + sizeof(TR_VBEEPMODE)) #endif #define OFS_TRNCHN (OFS_TRNMODE + sizeof(TR_TRNMODE)) +#if defined(PCBTARANIS) +#define OFS_UART3MODES (OFS_TRNCHN + sizeof(TR_TRNCHN)) +#define OFS_VTRIMINC (OFS_UART3MODES + sizeof(TR_UART3MODES)) +#else #define OFS_VTRIMINC (OFS_TRNCHN + sizeof(TR_TRNCHN)) +#endif #define OFS_RETA123 (OFS_VTRIMINC + sizeof(TR_VTRIMINC)) #define OFS_VPROTOS (OFS_RETA123 + sizeof(TR_RETA123)) #define OFS_POSNEG (OFS_VPROTOS + sizeof(TR_VPROTOS)) @@ -190,6 +195,7 @@ extern const pm_char STR_OPEN9X[]; #define STR_VBEEPMODE (STR_OPEN9X + OFS_VBEEPMODE) #define STR_TRNMODE (STR_OPEN9X + OFS_TRNMODE) #define STR_TRNCHN (STR_OPEN9X + OFS_TRNCHN) +#define STR_UART3MODES (STR_OPEN9X + OFS_UART3MODES) #define STR_VTRIMINC (STR_OPEN9X + OFS_VTRIMINC) #define STR_RETA123 (STR_OPEN9X + OFS_RETA123) #define STR_VPROTOS (STR_OPEN9X + OFS_VPROTOS) @@ -675,6 +681,7 @@ extern const pm_char STR_VIEW_TEXT[]; extern const pm_char STR_SCALE[]; extern const pm_char STR_VIEW_CHANNELS[]; extern const pm_char STR_VIEW_NOTES[]; + extern const pm_char STR_UART3MODE[]; #endif #if MENUS_LOCK == 1 diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index a1f79d75f..723a7b82b 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -24,6 +24,7 @@ * * * + * * !!!!! DO NOT EDIT cz.h - EDIT cz.h.txt INSTEAD !!!!!!! * * In order to make translations easier cz.h.txt is parsed and national @@ -31,7 +32,6 @@ * See translate.py in the util catalog for the list of character codes * * !!!!! DO NOT EDIT cz.h - EDIT cz.h.txt INSTEAD !!!!!!! - * */ /* Fotmatting octal codes available in TR_ strings: * \037\x -sets LCD x-coord (x value in octal) @@ -68,6 +68,9 @@ #define LEN_TRNCHN "\003" #define TR_TRNCHN "CH1CH2CH3CH4" +#define LEN_UART3MODES "\017" +#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART" + #define LEN_DATETIME "\006" #define TR_DATETIME "DATUM:""ČAS: " @@ -667,6 +670,7 @@ #define TR_CRITICALALARM INDENT "Kritický Alarm" #define TR_PERSISTENT_MAH INDENT "Store mAh" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") +#define TR_UART3MODE "Serial port" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index ac3f5c566..8b5a40dc1 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -23,6 +23,7 @@ * GNU General Public License for more details. * * + * * !!!!! DO NOT EDIT de.h - EDIT de.h.txt INSTEAD !!!!!!! * * In order to make translations easier de.h.txt is parsed and national @@ -67,6 +68,9 @@ #define LEN_TRNCHN "\003" #define TR_TRNCHN "CH1CH2CH3CH4" +#define LEN_UART3MODES "\017" +#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART" + #define LEN_DATETIME "\005" #define TR_DATETIME "DATE:""ZEIT:" @@ -669,6 +673,7 @@ #define TR_CRITICALALARM INDENT "Kritisch Alarm" #define TR_PERSISTENT_MAH INDENT "Store mAh" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") +#define TR_UART3MODE "Serial port" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/en.h b/radio/src/translations/en.h index 3357095e9..33eb7b97f 100644 --- a/radio/src/translations/en.h +++ b/radio/src/translations/en.h @@ -68,6 +68,9 @@ #define LEN_TRNCHN "\003" #define TR_TRNCHN "CH1CH2CH3CH4" +#define LEN_UART3MODES "\017" +#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART" + #define LEN_DATETIME "\005" #define TR_DATETIME "DATE:""TIME:" @@ -674,6 +677,7 @@ #define TR_CRITICALALARM INDENT "Critical Alarm" #define TR_PERSISTENT_MAH INDENT "Store mAh" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") +#define TR_UART3MODE "Serial port" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 5c531553e..01c95100b 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -23,6 +23,7 @@ * GNU General Public License for more details. * * + * * !!!!! DO NOT EDIT es.h - EDIT es.h.txt INSTEAD !!!!!!! * * In order to make translations easier es.h.txt is parsed and national @@ -67,6 +68,9 @@ #define LEN_TRNCHN "\003" #define TR_TRNCHN "CH1CH2CH3CH4" +#define LEN_UART3MODES "\017" +#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART" + #define LEN_DATETIME "\005" #define TR_DATETIME "DATA:""HORA:" @@ -666,6 +670,7 @@ #define TR_CRITICALALARM INDENT "Alarma Critica" #define TR_PERSISTENT_MAH INDENT "Valor mAh" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") +#define TR_UART3MODE "Serial port" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 0cc48f0f4..c442dd40e 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -23,6 +23,7 @@ * * * + * * !!!!! DO NOT EDIT fr.h - EDIT fr.h.txt INSTEAD !!!!!!! * * In order to make translations easier fr.h.txt is parsed and national @@ -67,6 +68,9 @@ #define LEN_TRNCHN "\003" #define TR_TRNCHN "CH1CH2CH3CH4" +#define LEN_UART3MODES "\017" +#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART" + #define LEN_DATETIME "\005" #define TR_DATETIME "DATE:""HEURE" @@ -666,6 +670,7 @@ #define TR_CRITICALALARM INDENT "Alarme critique" #define TR_PERSISTENT_MAH TR(INDENT "Enr. mAh",INDENT "Enregistrer mAh") #define TR_FAS_OFFSET TR(INDENT "Corr FAS", INDENT "Correction FAS") +#define TR_UART3MODE "Serial port" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 185579236..85fc15843 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -6,6 +6,7 @@ * - Martin Hotar * - Romolo Manfredini * + * * opentx is based on code named * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, * er9x by Erez Raviv: http://code.google.com/p/er9x/, @@ -67,6 +68,9 @@ #define LEN_TRNCHN "\003" #define TR_TRNCHN "ch1ch2ch3ch4" +#define LEN_UART3MODES "\017" +#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART" + #define LEN_DATETIME "\005" #define TR_DATETIME "DATA:""ORA :" @@ -666,6 +670,7 @@ #define TR_CRITICALALARM INDENT "Allarme Critico" #define TR_PERSISTENT_MAH INDENT "Store mAh" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") +#define TR_UART3MODE "Serial port" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 607a43aa6..c93f2f129 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -24,7 +24,6 @@ * * * - * * !!!!! DO NOT EDIT pl.h - EDIT pl.h.txt INSTEAD !!!!!!! * * In order to make translations easier pl.h.txt is parsed and national @@ -69,6 +68,9 @@ #define LEN_TRNCHN "\003" #define TR_TRNCHN "CH1CH2CH3CH4" +#define LEN_UART3MODES "\017" +#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART" + #define LEN_DATETIME "\006" #define TR_DATETIME "DANA:""Czas:\0 " @@ -668,6 +670,7 @@ #define TR_CRITICALALARM INDENT "Alarm krytyczny" #define TR_PERSISTENT_MAH INDENT "Store mAh" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") +#define TR_UART3MODE "Serial port" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index df3bb999c..fb51f22fe 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -23,6 +23,7 @@ * * * + * * !!!!! DO NOT EDIT pt.h - EDIT pt.h.txt INSTEAD !!!!!!! * * In order to make translations easier pt.h.txt is parsed and national @@ -67,6 +68,9 @@ #define LEN_TRNCHN "\003" #define TR_TRNCHN "CH1CH2CH3CH4" +#define LEN_UART3MODES "\017" +#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART" + #define LEN_DATETIME "\005" #define TR_DATETIME "DATA:""HORA:" @@ -666,6 +670,7 @@ #define TR_CRITICALALARM INDENT "Critical Alarm" #define TR_PERSISTENT_MAH INDENT "Store mAh" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") +#define TR_UART3MODE "Serial port" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index d690768ca..095a05648 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -23,6 +23,7 @@ * * * + * * !!!!! DO NOT EDIT se.h - EDIT se.h.txt INSTEAD !!!!!!! * * In order to make translations easier se.h.txt is parsed and national @@ -67,6 +68,9 @@ #define LEN_TRNCHN "\003" #define TR_TRNCHN "KN1KN2KN3KN4" +#define LEN_UART3MODES "\017" +#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART" + #define LEN_DATETIME "\005" #define TR_DATETIME "DAG: ""TID: " @@ -669,6 +673,7 @@ #define TR_CRITICALALARM INDENT "Kritiskt alarm" #define TR_PERSISTENT_MAH INDENT "Store mAh" #define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset") +#define TR_UART3MODE "Serial port" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"