diff --git a/src/main/rx/fport.c b/src/main/rx/fport.c index 3eaf6a3ccf..59418c1e0f 100644 --- a/src/main/rx/fport.c +++ b/src/main/rx/fport.c @@ -110,8 +110,14 @@ typedef struct fportFrame_s { #if defined(USE_SERIALRX_FPORT) +#if defined(USE_TELEMETRY_SMARTPORT) + +static bool telemetryEnabled = false; + static const smartPortPayload_t emptySmartPortFrame = { .frameId = 0, .valueId = 0, .data = 0 }; +#endif // USE_TELEMETRY_SMARTPORT + #define FPORT_REQUEST_FRAME_LENGTH sizeof(fportFrame_t) #define FPORT_RESPONSE_FRAME_LENGTH (sizeof(uint8_t) + sizeof(smartPortPayload_t)) @@ -140,7 +146,6 @@ static smartPortPayload_t *mspPayload = NULL; static timeUs_t lastRcFrameReceivedMs = 0; static serialPort_t *fportPort; -static bool telemetryEnabled = false; static void reportFrameError(uint8_t errorReason) { static volatile uint16_t frameErrors = 0; @@ -244,7 +249,9 @@ static bool checkChecksum(uint8_t *data, uint8_t length) static uint8_t fportFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig) { +#if defined(USE_TELEMETRY_SMARTPORT) static smartPortPayload_t payloadBuffer; +#endif static bool hasTelemetryRequest = false; uint8_t result = RX_FRAME_PENDING;