@@ -734,40 +734,49 @@ bool isTelemetryProtocolAvailable(int protocol)
|
||||
|
||||
bool isTrainerModeAvailable(int mode)
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
if (IS_EXTERNAL_MODULE_ENABLED() && (mode == TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE || mode == TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE))
|
||||
return false;
|
||||
switch(mode) {
|
||||
#if defined(HARDWARE_TRAINER_EXTERNAL_MODULE)
|
||||
case TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE:
|
||||
case TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE:
|
||||
return !IS_EXTERNAL_MODULE_ENABLED();
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E)
|
||||
if (g_eeGeneral.bluetoothMode && mode == TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE) {
|
||||
// bluetooth uses the same USART than SBUS
|
||||
return false;
|
||||
case TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE:
|
||||
// bluetooth uses the same USART than SBUS
|
||||
return !g_eeGeneral.bluetoothMode;
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_TRAINER_AUX_SERIAL)
|
||||
case TRAINER_MODE_MASTER_BATTERY_COMPARTMENT:
|
||||
return g_eeGeneral.auxSerialMode == UART_MODE_SBUS_TRAINER;
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_TRAINER_BLUETOOTH)
|
||||
case TRAINER_MODE_MASTER_BLUETOOTH:
|
||||
case TRAINER_MODE_SLAVE_BLUETOOTH:
|
||||
return g_eeGeneral.bluetoothMode == BLUETOOTH_TRAINER;
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_TRAINER_JACK)
|
||||
case TRAINER_MODE_MASTER_TRAINER_JACK:
|
||||
case TRAINER_MODE_SLAVE:
|
||||
return true;
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_TRAINER_MULTI)
|
||||
case TRAINER_MODE_MULTI:
|
||||
return true;
|
||||
#endif
|
||||
|
||||
#if !defined(TRAINER_DETECT_GPIO)
|
||||
case TRAINER_MODE_OFF:
|
||||
return true;
|
||||
#endif
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) && !defined(TRAINER_BATTERY_COMPARTMENT)
|
||||
if (mode == TRAINER_MODE_MASTER_BATTERY_COMPARTMENT)
|
||||
return false;
|
||||
#elif defined(PCBTARANIS)
|
||||
if (mode == TRAINER_MODE_MASTER_BATTERY_COMPARTMENT)
|
||||
return g_eeGeneral.auxSerialMode == UART_MODE_SBUS_TRAINER;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E)
|
||||
if (mode == TRAINER_MODE_MASTER_BLUETOOTH || mode == TRAINER_MODE_SLAVE_BLUETOOTH)
|
||||
return false;
|
||||
#elif defined(BLUETOOTH)
|
||||
if (g_eeGeneral.bluetoothMode != BLUETOOTH_TRAINER && (mode == TRAINER_MODE_MASTER_BLUETOOTH || mode == TRAINER_MODE_SLAVE_BLUETOOTH))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if defined(PCBXLITE) && !defined(PCBXLITES)
|
||||
if (mode == TRAINER_MODE_MASTER_TRAINER_JACK || mode == TRAINER_MODE_SLAVE)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool modelHasNotes()
|
||||
|
||||
Reference in New Issue
Block a user