From 2e83accbfe27adf2680481eec2e63ae4f284736c Mon Sep 17 00:00:00 2001 From: Bruce Luckcuck Date: Tue, 3 Jul 2018 08:44:21 -0400 Subject: [PATCH] Disable more telemetry types and fixup warning/errors if USE_SERIAL_RX is not defined --- src/main/rx/crsf.c | 2 +- src/main/rx/fport.c | 2 +- src/main/target/common_fc_post.h | 31 ++++++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/main/rx/crsf.c b/src/main/rx/crsf.c index 2f3753cb1..0e62f46ff 100644 --- a/src/main/rx/crsf.c +++ b/src/main/rx/crsf.c @@ -169,10 +169,10 @@ STATIC_UNIT_TESTED void crsfDataReceive(uint16_t c, void *data) break; } #endif +#if defined(USE_CRSF_CMS_TELEMETRY) case CRSF_FRAMETYPE_DEVICE_PING: crsfScheduleDeviceInfoResponse(); break; -#if defined(USE_CRSF_CMS_TELEMETRY) case CRSF_FRAMETYPE_DISPLAYPORT_CMD: { uint8_t *frameStart = (uint8_t *)&crsfFrame.frame.payload + CRSF_FRAME_ORIGIN_DEST_SIZE; crsfProcessDisplayPortCmd(frameStart); diff --git a/src/main/rx/fport.c b/src/main/rx/fport.c index 758865c46..b57d64acb 100644 --- a/src/main/rx/fport.c +++ b/src/main/rx/fport.c @@ -25,7 +25,7 @@ #include "platform.h" -#if defined(USE_SERIAL_RX) && defined(USE_SERIALRX_FPORT) +#if defined(USE_SERIALRX_FPORT) #include "build/debug.h" diff --git a/src/main/target/common_fc_post.h b/src/main/target/common_fc_post.h index 8f1328836..231a252c5 100644 --- a/src/main/target/common_fc_post.h +++ b/src/main/target/common_fc_post.h @@ -56,12 +56,41 @@ #endif #endif +#if !defined(USE_SERIAL_RX) +#undef USE_SERIALRX_CRSF +#undef USE_SERIALRX_IBUS +#undef USE_SERIALRX_JETIEXBUS +#undef USE_SERIALRX_SBUS +#undef USE_SERIALRX_SPEKTRUM +#undef USE_SERIALRX_SUMD +#undef USE_SERIALRX_SUMH +#undef USE_SERIALRX_XBUS +#undef USE_SERIALRX_FPORT +#endif + +#if !defined(USE_SERIALRX_CRSF) +#undef USE_TELEMETRY_CRSF +#endif + +#if !defined(USE_SERIALRX_SPEKTRUM) +#undef USE_TELEMETRY_JETIEXBUS +#endif + +#if !defined(USE_SERIALRX_JETIEXBUS) +#undef USE_TELEMETRY_SRXL +#endif + #if !defined(USE_TELEMETRY) +#undef USE_CRSF_CMS_TELEMETRY +#undef USE_TELEMETRY_CRSF #undef USE_TELEMETRY_FRSKY_HUB #undef USE_TELEMETRY_HOTT +#undef USE_TELEMETRY_IBUS +#undef USE_TELEMETRY_IBUS_EXTENDED +#undef USE_TELEMETRY_JETIEXBUS #undef USE_TELEMETRY_LTM +#undef USE_TELEMETRY_MAVLINK #undef USE_TELEMETRY_SMARTPORT -#undef USE_TELEMETRY_CRSF #undef USE_TELEMETRY_SRXL #undef USE_SERIALRX_FPORT #endif