R9M : activate automatically MODULE telem when possible (#5553)

* Fix #5543

* Auto activate R9M telem

* Adjust radio ui

* Thx @schwabe

* Stop being stupid ?

* PR rework

* [Companion] Removed "Module Telemetry" checkbox.
This commit is contained in:
3djc
2017-12-29 09:47:45 +01:00
committed by Bertrand Songis
parent 3cba3a76a4
commit 8ee9199abc
22 changed files with 157 additions and 146 deletions
+5 -1
View File
@@ -381,12 +381,16 @@ void setupPulsesPXX(uint8_t port)
extra_flags |= (g_model.moduleData[port].pxx.external_antenna << 0);
}
#endif
// Bit1 is ignored by R9M EU when power is set to 1500 mW
extra_flags |= (g_model.moduleData[port].pxx.receiver_telem_off << 1);
extra_flags |= (g_model.moduleData[port].pxx.receiver_channel_9_16 << 2);
if (IS_MODULE_R9M(port)) {
// For R9M EU, bit3 (MODE) is taken into account ONLY at bind time. Value change requires re-bind
extra_flags |= (min(g_model.moduleData[port].pxx.power, IS_MODULE_R9M_FCC(port) ? (uint8_t)R9M_FCC_POWER_MAX : (uint8_t)R9M_LBT_POWER_MAX) << 3);
// Disable S.PORT if internal module is active
if (IS_TELEMETRY_INTERNAL_MODULE() || !g_model.moduleData[port].pxx.sport_out) {
if (IS_TELEMETRY_INTERNAL_MODULE()) {
extra_flags |= (1 << 5);
}
}