Support for non certified firmwares (#6118)

* Support new r9m firmwares

* More future proof, thx Kilrah

* (significant) typo

* Companion part

* Make support a compilation option

* Fix compilation for normal users

* Warning popup for usability tests

* Better implementation

* All sizes

* Cosmetics

* Flex is EU+/AU+ only

* [Companion] Handle "flexr9m" option in module settings UI (to match radio UI, including warning msg); Move some "toString" functions out of ModelPrinter into ModuleData/Multiprotocols; "Future-proof" available R9M power options based on "stdr9m" fw option; Fix missing "Hitec" MM protocol name; Fix printing of R9M-EU power level in ModelPrinter.

* Cosmetics

* Rename R9M flex option

* Move failsafe further back to prevent nav oddity
This commit is contained in:
3djc
2018-08-30 13:16:39 +02:00
parent 6113494d08
commit 95c035ed73
35 changed files with 349 additions and 233 deletions
+10 -3
View File
@@ -771,8 +771,15 @@ void menuModelSetup(event_t event)
case 1:
if (isModuleDSM2(EXTERNAL_MODULE))
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, DSM2_PROTO_LP45, DSM2_PROTO_DSMX);
else if (isModuleR9M(EXTERNAL_MODULE))
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].subType, MODULE_SUBTYPE_R9M_FCC, MODULE_SUBTYPE_R9M_LBT);
else if (isModuleR9M(EXTERNAL_MODULE)) {
uint8_t newR9MType = checkIncDec(event, g_model.moduleData[EXTERNAL_MODULE].subType, MODULE_SUBTYPE_R9M_FCC, MODULE_SUBTYPE_R9M_LAST, EE_MODEL, isR9MModeAvailable);
if (newR9MType != g_model.moduleData[EXTERNAL_MODULE].subType && newR9MType > MODULE_SUBTYPE_R9M_EU) {
POPUP_WARNING(STR_R9MFLEXWARN1);
const char * w = STR_R9MFLEXWARN2;
SET_WARNING_INFO(w, strlen(w), 0);
}
g_model.moduleData[EXTERNAL_MODULE].subType = newR9MType;
}
#if defined(MULTIMODULE)
else if (isModuleMultimodule(EXTERNAL_MODULE)) {
int multiRfProto = g_model.moduleData[EXTERNAL_MODULE].multi.customProto == 1 ? MM_RF_PROTO_CUSTOM : g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(false);
@@ -1143,7 +1150,7 @@ void menuModelSetup(event_t event)
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
if (isModuleR9M(moduleIdx)) {
lcdDrawTextAlignedLeft(y, TR_MULTI_RFPOWER);
if(isModuleR9M_FCC(moduleIdx)) {
if(IS_MODULE_R9M_FCC_VARIANT(moduleIdx)) {
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_R9M_FCC_POWER_VALUES, g_model.moduleData[moduleIdx].pxx.power, LEFT | attr);
if (attr)
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[moduleIdx].pxx.power, 0, R9M_FCC_POWER_MAX);