From 8e249ce1876d639437ff75e907cc850ef79b6e7b Mon Sep 17 00:00:00 2001 From: "Konstantin Sharlaimov (DigitalEntity)" Date: Mon, 17 Oct 2016 18:43:28 +1000 Subject: [PATCH] Allow MAVLink telemetry only for targets with >128K flash --- src/main/target/common.h | 1 + src/main/telemetry/mavlink.c | 3 ++- src/main/telemetry/telemetry.c | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/target/common.h b/src/main/target/common.h index bb7cd7f045..9072918f4f 100644 --- a/src/main/target/common.h +++ b/src/main/target/common.h @@ -55,6 +55,7 @@ #if (FLASH_SIZE > 128) #define DISPLAY +#define TELEMETRY_MAVLINK #else #define SKIP_CLI_COMMAND_HELP #define SKIP_RX_MSP diff --git a/src/main/telemetry/mavlink.c b/src/main/telemetry/mavlink.c index 01ad110b00..7f75609401 100755 --- a/src/main/telemetry/mavlink.c +++ b/src/main/telemetry/mavlink.c @@ -26,7 +26,7 @@ #include "platform.h" -#if defined(TELEMETRY) +#if defined(TELEMETRY) && defined(TELEMETRY_MAVLINK) #include "common/maths.h" #include "common/axis.h" @@ -456,6 +456,7 @@ void mavlinkSendHUDAndHeartbeat(void) break; case MIXER_FLYING_WING: case MIXER_AIRPLANE: + case MIXER_CUSTOM_AIRPLANE: mavSystemType = MAV_TYPE_FIXED_WING; break; case MIXER_HELI_120_CCPM: diff --git a/src/main/telemetry/telemetry.c b/src/main/telemetry/telemetry.c index ed7845b942..d2252077ed 100644 --- a/src/main/telemetry/telemetry.c +++ b/src/main/telemetry/telemetry.c @@ -59,6 +59,10 @@ void telemetryInit(void) initLtmTelemetry(telemetryConfig); initJetiExBusTelemetry(telemetryConfig); +#if defined(TELEMETRY_MAVLINK) + initMAVLinkTelemetry(); +#endif + telemetryCheckState(); } @@ -90,7 +94,10 @@ void telemetryCheckState(void) checkSmartPortTelemetryState(); checkLtmTelemetryState(); checkJetiExBusTelemetryState(); + +#if defined(TELEMETRY_MAVLINK) checkMAVLinkTelemetryState(); +#endif } void telemetryProcess(uint32_t currentTime, rxConfig_t *rxConfig, uint16_t deadband3d_throttle) @@ -100,7 +107,10 @@ void telemetryProcess(uint32_t currentTime, rxConfig_t *rxConfig, uint16_t deadb handleSmartPortTelemetry(); handleLtmTelemetry(); handleJetiExBusTelemetry(); + +#if defined(TELEMETRY_MAVLINK) handleMAVLinkTelemetry(); +#endif } #endif