Prevent X9E simu crash when BT is enabled (#5966)
* Better 'non horus BT' XE handling * Cleanup * Adjust BT message for X9E * [Companion][HardwarePanel][X9E] Change BT Mode options to OFF/Enabled, X9E only.
This commit is contained in:
@@ -262,6 +262,7 @@ void bluetoothReceiveTrainer()
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
void bluetoothWakeup(void)
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
if (!g_eeGeneral.bluetoothMode) {
|
||||
if (bluetoothState != BLUETOOTH_INIT) {
|
||||
bluetoothDone();
|
||||
@@ -317,6 +318,7 @@ void bluetoothWakeup(void)
|
||||
bluetoothSendTrainer();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else // PCBX9E
|
||||
void bluetoothWakeup()
|
||||
|
||||
@@ -55,7 +55,9 @@ enum menuRadioHwItems {
|
||||
CASE_PCBX9E(ITEM_RADIO_HARDWARE_SQ)
|
||||
CASE_PCBX9E(ITEM_RADIO_HARDWARE_SR)
|
||||
CASE_BLUETOOTH(ITEM_RADIO_HARDWARE_BLUETOOTH_MODE)
|
||||
#if defined(USEHORUSBT)
|
||||
CASE_BLUETOOTH(ITEM_RADIO_HARDWARE_BLUETOOTH_NAME)
|
||||
#endif
|
||||
ITEM_RADIO_HARDWARE_UART3_MODE,
|
||||
ITEM_RADIO_HARDWARE_JITTER_FILTER,
|
||||
ITEM_RADIO_HARDWARE_MAX
|
||||
@@ -80,7 +82,7 @@ enum menuRadioHwItems {
|
||||
#if defined(BLUETOOTH) && defined(USEHORUSBT)
|
||||
#define BLUETOOTH_ROWS 0, uint8_t(g_eeGeneral.bluetoothMode == BLUETOOTH_OFF ? -1 : 0),
|
||||
#else
|
||||
#define BLUETOOTH_ROWS
|
||||
#define BLUETOOTH_ROWS (uint8_t)0,
|
||||
#endif
|
||||
|
||||
#define SWITCH_TYPE_MAX(sw) ((MIXSRC_SF-MIXSRC_FIRST_SWITCH == sw || MIXSRC_SH-MIXSRC_FIRST_SWITCH == sw) ? SWITCH_2POS : SWITCH_3POS)
|
||||
@@ -198,19 +200,24 @@ void menuRadioHardware(event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(BLUETOOTH) && defined(USEHORUSBT)
|
||||
#if defined(BLUETOOTH)
|
||||
case ITEM_RADIO_HARDWARE_BLUETOOTH_MODE:
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_BLUETOOTH);
|
||||
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_BLUETOOTH_MODES, g_eeGeneral.bluetoothMode, attr);
|
||||
if (attr) {
|
||||
#if defined(USEHORUSBT)
|
||||
g_eeGeneral.bluetoothMode = checkIncDecGen(event, g_eeGeneral.bluetoothMode, BLUETOOTH_OFF, BLUETOOTH_TRAINER);
|
||||
#else
|
||||
g_eeGeneral.bluetoothMode = checkIncDecGen(event, g_eeGeneral.bluetoothMode, BLUETOOTH_OFF, BLUETOOTH_TELEMETRY);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(USEHORUSBT)
|
||||
case ITEM_RADIO_HARDWARE_BLUETOOTH_NAME:
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_NAME);
|
||||
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.bluetoothName, LEN_BLUETOOTH_NAME, event, attr);
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
case ITEM_RADIO_HARDWARE_UART3_MODE:
|
||||
|
||||
+1
-7
@@ -155,7 +155,7 @@
|
||||
#define CASE_SDCARD(x)
|
||||
#endif
|
||||
|
||||
#if defined(BLUETOOTH) && !(defined(PCBX9E) && !defined(USEHORUSBT))
|
||||
#if defined(BLUETOOTH)
|
||||
#define CASE_BLUETOOTH(x) x,
|
||||
#else
|
||||
#define CASE_BLUETOOTH(x)
|
||||
@@ -203,12 +203,6 @@
|
||||
#define CASE_PCBX9E(x)
|
||||
#endif
|
||||
|
||||
#if defined(BLUETOOTH) && !(defined(PCBX9E) && !defined(USEHORUSBT))
|
||||
#define CASE_BLUETOOTH(x) x,
|
||||
#else
|
||||
#define CASE_BLUETOOTH(x)
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X) && !defined(AR9X) && !defined(REVA)
|
||||
#define TX_CAPACITY_MEASUREMENT
|
||||
#define CASE_CAPACITY(x) x,
|
||||
|
||||
@@ -980,8 +980,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "BT Baudrate"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD INFO"
|
||||
#define TR_SD_TYPE "Typ:"
|
||||
#define TR_SD_SPEED "Rychlost:"
|
||||
|
||||
@@ -997,9 +997,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "BT Baudrate"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
|
||||
##if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD-INFO"
|
||||
#define TR_SD_TYPE "Typ:"
|
||||
#define TR_SD_SPEED "Geschw:"
|
||||
|
||||
@@ -985,8 +985,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "BT Baudrate"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD INFO"
|
||||
#define TR_SD_TYPE "Type:"
|
||||
#define TR_SD_SPEED "Speed:"
|
||||
|
||||
@@ -976,8 +976,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "BT Baudrate"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD INFO"
|
||||
#define TR_SD_TYPE "Tipo:"
|
||||
#define TR_SD_SPEED "Velocidad:"
|
||||
|
||||
@@ -968,8 +968,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "BT Baudrate"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD INFO"
|
||||
#define TR_SD_TYPE "Type:"
|
||||
#define TR_SD_SPEED "Speed:"
|
||||
|
||||
@@ -1005,7 +1005,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "Baudrate BT"
|
||||
#define LEN_BLUETOOTH_MODES "\012"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Activé\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Télémétrie""Ecolage\0"
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "INFO SD"
|
||||
#define TR_SD_TYPE "Type:"
|
||||
#define TR_SD_SPEED "Vitesse:"
|
||||
|
||||
@@ -993,8 +993,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "BT Baudrate"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD INFO"
|
||||
#define TR_SD_TYPE "Tipo:"
|
||||
#define TR_SD_SPEED "Veloc.:"
|
||||
|
||||
@@ -984,8 +984,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "BT Baudrate"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD-INFO"
|
||||
#define TR_SD_TYPE "Type:"
|
||||
#define TR_SD_SPEED "Snelheid:"
|
||||
|
||||
@@ -995,9 +995,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "Prędkość BT"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD INFO"
|
||||
#define TR_SD_TYPE "Typ:"
|
||||
#define TR_SD_SPEED "Prędkość:"
|
||||
|
||||
@@ -975,8 +975,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "BT Baudrate"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD INFO"
|
||||
#define TR_SD_TYPE "Tipe"
|
||||
#define TR_SD_SPEED "Velocidade"
|
||||
|
||||
@@ -1003,8 +1003,11 @@
|
||||
#define TR_BLUETOOTH_PIN_CODE TR(INDENT "PIN code", "PIN code")
|
||||
#define TR_BAUDRATE "BT Baudrate"
|
||||
#define LEN_BLUETOOTH_MODES "\011"
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT)
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Enabled\0 "
|
||||
#else
|
||||
#define TR_BLUETOOTH_MODES "---\0 ""Telemetry""Trainer\0"
|
||||
|
||||
#endif
|
||||
#define TR_SD_INFO_TITLE "SD INFO"
|
||||
#define TR_SD_TYPE "Typ: "
|
||||
#define TR_SD_SPEED "Hastighet:"
|
||||
|
||||
Reference in New Issue
Block a user