Reduce RF_PROTO_OFF logic, disable R9M Sport out when internal telemetry is on (#5159)
* Remove most of the special logic associated with RF_PROTO_OFF This simplifies code in many areas since the internal module does not require special handling and also fixes a few bugs with INTERNAL_PPM * Disable R9M sport option if internal module has telemetry * Fix X12s build * Use macros instead of direct comparisions * Fix sport bit sent the wrong way. Rename S.port out to Telemetry * Compile fix
This commit is contained in:
committed by
Bertrand Songis
parent
8e84724c62
commit
e16b48db30
@@ -127,13 +127,8 @@ enum MenuModelSetupItems {
|
||||
#else
|
||||
#define INTERNAL_MODULE_MODE_ROWS (IS_MODULE_XJT(INTERNAL_MODULE) ? (uint8_t)1 : (uint8_t)0) // Module type + RF protocols
|
||||
#endif
|
||||
#if defined(TARANIS_INTERNAL_PPM)
|
||||
#define IF_INTERNAL_MODULE_ON(x) (g_model.moduleData[INTERNAL_MODULE].type == MODULE_TYPE_NONE ? HIDDEN_ROW : (uint8_t)(x))
|
||||
#else
|
||||
#define IF_INTERNAL_MODULE_ON(x) (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF ? HIDDEN_ROW : (uint8_t)(x))
|
||||
#endif
|
||||
|
||||
#define IF_EXTERNAL_MODULE_ON(x) (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_NONE ? HIDDEN_ROW : (uint8_t)(x))
|
||||
#define IF_INTERNAL_MODULE_ON(x) (IS_INTERNAL_MODULE_ENABLED()? (uint8_t)(x) : HIDDEN_ROW )
|
||||
#define IF_EXTERNAL_MODULE_ON(x) (IS_EXTERNAL_MODULE_ENABLED()? (uint8_t)(x) : HIDDEN_ROW)
|
||||
#define INTERNAL_MODULE_CHANNELS_ROWS IF_INTERNAL_MODULE_ON(1)
|
||||
#define EXTERNAL_MODULE_BIND_ROWS() (IS_MODULE_XJT(EXTERNAL_MODULE) && IS_D8_RX(EXTERNAL_MODULE)) ? (uint8_t)1 : (IS_MODULE_PPM(EXTERNAL_MODULE) || IS_MODULE_PXX(EXTERNAL_MODULE) || IS_MODULE_DSM2(EXTERNAL_MODULE) || IS_MODULE_MULTIMODULE(EXTERNAL_MODULE)) ? (uint8_t)2 : HIDDEN_ROW
|
||||
|
||||
@@ -684,6 +679,8 @@ void menuModelSetup(event_t event)
|
||||
g_model.moduleData[0].type = MODULE_TYPE_XJT;
|
||||
g_model.moduleData[0].channelsStart = 0;
|
||||
g_model.moduleData[0].channelsCount = DEFAULT_CHANNELS(INTERNAL_MODULE);
|
||||
if (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF)
|
||||
g_model.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_NONE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1082,7 +1079,13 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
#endif
|
||||
if (IS_MODULE_R9M(moduleIdx)) {
|
||||
g_model.moduleData[moduleIdx].pxx.sport_out = editCheckBox(g_model.moduleData[EXTERNAL_MODULE].pxx.sport_out, MODEL_SETUP_2ND_COLUMN, y, STR_SPORT_OUT, attr, event);
|
||||
if (IS_TELEMETRY_INTERNAL_MODULE) {
|
||||
lcdDrawTextAlignedLeft(y, STR_SPORT_OUT);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_DISABLE_INTERNAL);
|
||||
}
|
||||
else {
|
||||
g_model.moduleData[moduleIdx].pxx.sport_out = editCheckBox(g_model.moduleData[EXTERNAL_MODULE].pxx.sport_out, MODEL_SETUP_2ND_COLUMN, y, STR_SPORT_OUT, attr, event);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user