Use static table to determine the existence of channel mapping option
This commit is contained in:
@@ -793,7 +793,7 @@ class ModuleWindow : public FormGroup {
|
||||
GET_SET_DEFAULT(
|
||||
g_model.moduleData[moduleIdx].multi.disableTelemetry));
|
||||
|
||||
if (MULTI_DISABLE_CHAN_MAP_ROW(moduleIdx) != HIDDEN_ROW) {
|
||||
if (MULTI_DISABLE_CHAN_MAP_ROW_STATIC(moduleIdx) != HIDDEN_ROW) {
|
||||
// Disable channel mapping
|
||||
grid.nextLine();
|
||||
new StaticText(this, grid.getLabelSlot(true), STR_DISABLE_CH_MAP);
|
||||
|
||||
@@ -220,6 +220,21 @@ inline uint8_t IF_ALLOW_RACING_MODE(int)
|
||||
#endif
|
||||
|
||||
#if defined(MULTIMODULE)
|
||||
inline uint8_t MULTI_DISABLE_CHAN_MAP_ROW_STATIC(uint8_t moduleIdx)
|
||||
{
|
||||
if (!isModuleMultimodule(moduleIdx))
|
||||
return HIDDEN_ROW;
|
||||
|
||||
uint8_t protocol = g_model.moduleData[moduleIdx].getMultiProtocol();
|
||||
if (protocol < MODULE_SUBTYPE_MULTI_LAST) {
|
||||
const mm_protocol_definition * pdef = getMultiProtocolDefinition(protocol);
|
||||
if (pdef->disable_ch_mapping)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
inline uint8_t MULTI_DISABLE_CHAN_MAP_ROW(uint8_t moduleIdx)
|
||||
{
|
||||
if (!isModuleMultimodule(moduleIdx))
|
||||
@@ -230,14 +245,7 @@ inline uint8_t MULTI_DISABLE_CHAN_MAP_ROW(uint8_t moduleIdx)
|
||||
return status.supportsDisableMapping() == true ? 0 : HIDDEN_ROW;
|
||||
}
|
||||
|
||||
uint8_t protocol = g_model.moduleData[moduleIdx].getMultiProtocol();
|
||||
if (protocol < MODULE_SUBTYPE_MULTI_LAST) {
|
||||
const mm_protocol_definition * pdef = getMultiProtocolDefinition(protocol);
|
||||
if (pdef->disable_ch_mapping)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return HIDDEN_ROW;
|
||||
return MULTI_DISABLE_CHAN_MAP_ROW_STATIC(moduleIdx);
|
||||
}
|
||||
|
||||
inline bool isMultiProtocolSelectable(int protocol)
|
||||
|
||||
Reference in New Issue
Block a user