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
+4 -4
View File
@@ -216,8 +216,8 @@ inline void SEND_FAILSAFE_1S()
void setCustomFailsafe(uint8_t moduleIndex);
#if defined(PCBXLITE) && !defined(MODULE_R9M_FULLSIZE)
#define LEN_R9M_REGION "\007"
#define TR_R9M_REGION "FCC\0 ""LBT(EU)"
#define LEN_R9M_REGION "\003"
#define TR_R9M_REGION "FCC""EU\0""EU+""AU+"
#define LEN_R9M_FCC_POWER_VALUES "\010"
#define LEN_R9M_LBT_POWER_VALUES "\015"
#define TR_R9M_FCC_POWER_VALUES "(100 mW)"
@@ -240,8 +240,8 @@ enum R9MLBTPowerValues {
#else
#define LEN_R9M_REGION "\007"
#define TR_R9M_REGION "FCC\0 ""LBT(EU)"
#define LEN_R9M_REGION "\003"
#define TR_R9M_REGION "FCC""EU\0""EU+""AU+"
#define LEN_R9M_FCC_POWER_VALUES "\006"
#define LEN_R9M_LBT_POWER_VALUES "\013"
#define TR_R9M_FCC_POWER_VALUES "10 mW\0" "100 mW" "500 mW" "1 W\0"
+3 -1
View File
@@ -412,7 +412,9 @@ inline void setupFramePXX(uint8_t port, uint8_t sendUpperChannels)
extra_flags |= (g_model.moduleData[port].pxx.receiver_telem_off << 1);
extra_flags |= (g_model.moduleData[port].pxx.receiver_channel_9_16 << 2);
if (isModuleR9M(port)) {
extra_flags |= (min(g_model.moduleData[port].pxx.power, isModuleR9M_FCC(port) ? (uint8_t)R9M_FCC_POWER_MAX : (uint8_t)R9M_LBT_POWER_MAX) << 3);
extra_flags |= (min(g_model.moduleData[port].pxx.power, IS_MODULE_R9M_FCC_VARIANT(port) ? (uint8_t)R9M_FCC_POWER_MAX : (uint8_t)R9M_LBT_POWER_MAX) << 3);
if(IS_MODULE_R9M_EUPLUS(port))
extra_flags |= (1 << 6);
}
// Disable S.PORT if internal module is active