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:
Arne Schwabe
2017-08-15 21:47:45 -07:00
committed by Bertrand Songis
parent 8e84724c62
commit e16b48db30
29 changed files with 87 additions and 60 deletions
+2 -4
View File
@@ -39,11 +39,12 @@ uint8_t getRequiredProtocol(uint8_t port)
switch (port) {
#if defined(PCBTARANIS) || defined(PCBHORUS)
case INTERNAL_MODULE:
#if defined(TARANIS_INTERNAL_PPM)
switch (g_model.moduleData[INTERNAL_MODULE].type) {
#if defined(TARANIS_INTERNAL_PPM)
case MODULE_TYPE_PPM:
required_protocol = PROTO_PPM;
break;
#endif
case MODULE_TYPE_XJT:
required_protocol = PROTO_PXX;
break;
@@ -51,9 +52,6 @@ uint8_t getRequiredProtocol(uint8_t port)
required_protocol = PROTO_NONE;
break;
}
#else
required_protocol = g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF ? PROTO_NONE : PROTO_PXX;
#endif
break;
#endif