Fix various compiler warnings for combinations of undefined USE_ features
This commit is contained in:
parent
8e9e757448
commit
a769d43b90
|
@ -558,7 +558,9 @@ bool isAirmodeActivated()
|
||||||
bool processRx(timeUs_t currentTimeUs)
|
bool processRx(timeUs_t currentTimeUs)
|
||||||
{
|
{
|
||||||
static bool armedBeeperOn = false;
|
static bool armedBeeperOn = false;
|
||||||
|
#ifdef USE_TELEMETRY
|
||||||
static bool sharedPortTelemetryEnabled = false;
|
static bool sharedPortTelemetryEnabled = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!calculateRxChannelsAndUpdateFailsafe(currentTimeUs)) {
|
if (!calculateRxChannelsAndUpdateFailsafe(currentTimeUs)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#if defined(USE_SERIAL_RX)
|
#if defined(USE_SERIAL_RX) && defined(USE_SERIALRX_FPORT)
|
||||||
|
|
||||||
#include "build/debug.h"
|
#include "build/debug.h"
|
||||||
|
|
||||||
|
@ -114,7 +114,9 @@ typedef struct fportFrame_s {
|
||||||
fportData_t data;
|
fportData_t data;
|
||||||
} fportFrame_t;
|
} fportFrame_t;
|
||||||
|
|
||||||
|
#ifdef USE_TELEMETRY_SMARTPORT
|
||||||
static const smartPortPayload_t emptySmartPortFrame = { .frameId = 0, .valueId = 0, .data = 0 };
|
static const smartPortPayload_t emptySmartPortFrame = { .frameId = 0, .valueId = 0, .data = 0 };
|
||||||
|
#endif
|
||||||
|
|
||||||
#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))
|
||||||
|
@ -144,7 +146,9 @@ static smartPortPayload_t *mspPayload = NULL;
|
||||||
static timeUs_t lastRcFrameReceivedMs = 0;
|
static timeUs_t lastRcFrameReceivedMs = 0;
|
||||||
|
|
||||||
static serialPort_t *fportPort;
|
static serialPort_t *fportPort;
|
||||||
|
#ifdef USE_TELEMETRY_SMARTPORT
|
||||||
static bool telemetryEnabled = false;
|
static bool telemetryEnabled = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
static void reportFrameError(uint8_t errorReason) {
|
static void reportFrameError(uint8_t errorReason) {
|
||||||
static volatile uint16_t frameErrors = 0;
|
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)
|
static uint8_t fportFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
|
||||||
{
|
{
|
||||||
|
#ifdef 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;
|
||||||
|
|
|
@ -56,6 +56,16 @@
|
||||||
#endif
|
#endif
|
||||||
#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_MSP_OVER_TELEMETRY)
|
||||||
#if !defined(USE_TELEMETRY_SMARTPORT) && !defined(USE_TELEMETRY_CRSF)
|
#if !defined(USE_TELEMETRY_SMARTPORT) && !defined(USE_TELEMETRY_CRSF)
|
||||||
#undef USE_MSP_OVER_TELEMETRY
|
#undef USE_MSP_OVER_TELEMETRY
|
||||||
|
|
|
@ -472,6 +472,8 @@ void processSmartPortTelemetry(smartPortPayload_t *payload, volatile bool *clear
|
||||||
uint8_t *frameStart = (uint8_t *)&payload->valueId;
|
uint8_t *frameStart = (uint8_t *)&payload->valueId;
|
||||||
smartPortMspReplyPending = handleMspFrame(frameStart, SMARTPORT_MSP_PAYLOAD_SIZE);
|
smartPortMspReplyPending = handleMspFrame(frameStart, SMARTPORT_MSP_PAYLOAD_SIZE);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
UNUSED(payload);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool doRun = true;
|
bool doRun = true;
|
||||||
|
|
Loading…
Reference in New Issue