Merge branch 'bsongis/pxx2' into bsongis/x-lites

This commit is contained in:
Bertrand Songis
2019-02-01 14:19:08 +01:00
55 changed files with 612 additions and 509 deletions
+37 -4
View File
@@ -486,6 +486,15 @@ bool isSourceAvailableInResetSpecialFunction(int index)
}
}
bool isR9ModuleRunning(int module)
{
#if defined(SIMU)
return g_model.moduleData[module].type == MODULE_TYPE_R9M && TELEMETRY_STREAMING(); // Simu uses telemetry simu to activate/desactivate R9
#else
return g_model.moduleData[module].type == MODULE_TYPE_R9M && R9ModuleStreaming;
#endif
}
#if defined(PCBXLITE)
bool isR9MModeAvailable(int mode)
{
#if defined(MODULE_R9M_FLEX_FW)
@@ -495,6 +504,17 @@ bool isR9MModeAvailable(int mode)
#endif
}
#else
bool isR9MModeAvailable(int mode)
{
return mode <= MODULE_SUBTYPE_R9M_EUPLUS;
}
#endif
bool isR9MMFlex(int module)
{
return g_model.moduleData[module].r9m.region == MODULE_R9M_REGION_FLEX;
}
bool isModuleAvailable(int module)
{
#if defined(CROSSFIRE)
@@ -516,7 +536,14 @@ bool isModuleAvailable(int module)
return false;
}
#endif
#if defined(PCBTARANIS) || defined(PCBHORUS)
if (module == MODULE_TYPE_R9M && g_model.moduleData[INTERNAL_MODULE].type != MODULE_TYPE_NONE) {
return false;
}
#endif
return true;
}
bool isRfProtocolAvailable(int protocol)
@@ -531,29 +558,35 @@ bool isRfProtocolAvailable(int protocol)
return false;
}
#endif
#if defined(PCBTARANIS) || defined(PCBHORUS)
if (protocol != RF_PROTO_OFF && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_R9M) {
return false;
}
#endif
return true;
}
bool isTelemetryProtocolAvailable(int protocol)
{
#if defined(PCBTARANIS)
if (protocol == PROTOCOL_FRSKY_D_SECONDARY && g_eeGeneral.serial2Mode != UART_MODE_TELEMETRY) {
if (protocol == PROTOCOL_TELEMETRY_FRSKY_D_SECONDARY && g_eeGeneral.serial2Mode != UART_MODE_TELEMETRY) {
return false;
}
#endif
if (protocol== PROTOCOL_PULSES_CROSSFIRE) {
if (protocol== PROTOCOL_TELEMETRY_CROSSFIRE) {
return false;
}
#if !defined(MULTIMODULE)
if (protocol == PROTOCOL_SPEKTRUM || protocol == PROTOCOL_FLYSKY_IBUS || protocol == PROTOCOL_MULTIMODULE) {
if (protocol == PROTOCOL_TELEMETRY_SPEKTRUM || protocol == PROTOCOL_TELEMETRY_FLYSKY_IBUS || protocol == PROTOCOL_TELEMETRY_MULTIMODULE) {
return false;
}
#endif
#if defined(PCBHORUS)
if (protocol == PROTOCOL_FRSKY_D_SECONDARY) {
if (protocol == PROTOCOL_TELEMETRY_FRSKY_D_SECONDARY) {
return false;
}
#endif