1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 08:15:26 +03:00

Fix warnings when building without USE_TELEMETRY_SMARTPORT

This commit is contained in:
Michel Pastor 2018-07-25 16:33:29 +02:00
parent 11f1762d45
commit 5ced75a375

View file

@ -110,8 +110,14 @@ typedef struct fportFrame_s {
#if defined(USE_SERIALRX_FPORT) #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 }; 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_REQUEST_FRAME_LENGTH sizeof(fportFrame_t)
#define FPORT_RESPONSE_FRAME_LENGTH (sizeof(uint8_t) + sizeof(smartPortPayload_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 timeUs_t lastRcFrameReceivedMs = 0;
static serialPort_t *fportPort; static serialPort_t *fportPort;
static bool telemetryEnabled = false;
static void reportFrameError(uint8_t errorReason) { static void reportFrameError(uint8_t errorReason) {
static volatile uint16_t frameErrors = 0; 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) static uint8_t fportFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
{ {
#if defined(USE_TELEMETRY_SMARTPORT)
static smartPortPayload_t payloadBuffer; static smartPortPayload_t payloadBuffer;
#endif
static bool hasTelemetryRequest = false; static bool hasTelemetryRequest = false;
uint8_t result = RX_FRAME_PENDING; uint8_t result = RX_FRAME_PENDING;