[color] Dynamic MPM proto list
This commit is contained in:
@@ -274,21 +274,24 @@ inline bool MULTIMODULE_PROTOCOL_KNOWN(uint8_t moduleIdx)
|
||||
inline bool MULTIMODULE_HAS_SUBTYPE(uint8_t moduleIdx)
|
||||
{
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
int proto = g_model.moduleData[moduleIdx].getMultiProtocol();
|
||||
|
||||
if (g_model.moduleData[moduleIdx].getMultiProtocol() == MODULE_SUBTYPE_MULTI_FRSKY) {
|
||||
if (proto == MODULE_SUBTYPE_MULTI_FRSKY) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (status.isValid()) {
|
||||
TRACE("(%d) status.protocolSubNbr = %d", proto, status.protocolSubNbr);
|
||||
return status.protocolSubNbr > 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g_model.moduleData[moduleIdx].getMultiProtocol() > MODULE_SUBTYPE_MULTI_LAST) {
|
||||
if (proto > MODULE_SUBTYPE_MULTI_LAST) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return getMultiProtocolDefinition(g_model.moduleData[moduleIdx].getMultiProtocol())->subTypeString != nullptr;
|
||||
auto subProto = getMultiProtocolDefinition(proto);
|
||||
return subProto->subTypeString != nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user