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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user