Fix various compiler warnings for combinations of undefined USE_ features

This commit is contained in:
Bruce Luckcuck 2018-07-01 20:21:00 -04:00
parent 8e9e757448
commit a769d43b90
4 changed files with 21 additions and 1 deletions

View File

@ -558,7 +558,9 @@ bool isAirmodeActivated()
bool processRx(timeUs_t currentTimeUs)
{
static bool armedBeeperOn = false;
#ifdef USE_TELEMETRY
static bool sharedPortTelemetryEnabled = false;
#endif
if (!calculateRxChannelsAndUpdateFailsafe(currentTimeUs)) {
return false;

View File

@ -25,7 +25,7 @@
#include "platform.h"
#if defined(USE_SERIAL_RX)
#if defined(USE_SERIAL_RX) && defined(USE_SERIALRX_FPORT)
#include "build/debug.h"
@ -114,7 +114,9 @@ typedef struct fportFrame_s {
fportData_t data;
} fportFrame_t;
#ifdef USE_TELEMETRY_SMARTPORT
static const smartPortPayload_t emptySmartPortFrame = { .frameId = 0, .valueId = 0, .data = 0 };
#endif
#define FPORT_REQUEST_FRAME_LENGTH sizeof(fportFrame_t)
#define FPORT_RESPONSE_FRAME_LENGTH (sizeof(uint8_t) + sizeof(smartPortPayload_t))
@ -144,7 +146,9 @@ static smartPortPayload_t *mspPayload = NULL;
static timeUs_t lastRcFrameReceivedMs = 0;
static serialPort_t *fportPort;
#ifdef USE_TELEMETRY_SMARTPORT
static bool telemetryEnabled = false;
#endif
static void reportFrameError(uint8_t errorReason) {
static volatile uint16_t frameErrors = 0;
@ -248,7 +252,9 @@ static bool checkChecksum(uint8_t *data, uint8_t length)
static uint8_t fportFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
{
#ifdef USE_TELEMETRY_SMARTPORT
static smartPortPayload_t payloadBuffer;
#endif
static bool hasTelemetryRequest = false;
uint8_t result = RX_FRAME_PENDING;

View File

@ -56,6 +56,16 @@
#endif
#endif
#if !defined(USE_TELEMETRY)
#undef USE_TELEMETRY_FRSKY_HUB
#undef USE_TELEMETRY_HOTT
#undef USE_TELEMETRY_LTM
#undef USE_TELEMETRY_SMARTPORT
#undef USE_TELEMETRY_CRSF
#undef USE_TELEMETRY_SRXL
#undef USE_SERIALRX_FPORT
#endif
#if defined(USE_MSP_OVER_TELEMETRY)
#if !defined(USE_TELEMETRY_SMARTPORT) && !defined(USE_TELEMETRY_CRSF)
#undef USE_MSP_OVER_TELEMETRY

View File

@ -472,6 +472,8 @@ void processSmartPortTelemetry(smartPortPayload_t *payload, volatile bool *clear
uint8_t *frameStart = (uint8_t *)&payload->valueId;
smartPortMspReplyPending = handleMspFrame(frameStart, SMARTPORT_MSP_PAYLOAD_SIZE);
}
#else
UNUSED(payload);
#endif
bool doRun = true;