diff --git a/src/main/drivers/accgyro/accgyro_spi_bmi160.c b/src/main/drivers/accgyro/accgyro_spi_bmi160.c index 31260a0f96..fbf4aacb81 100644 --- a/src/main/drivers/accgyro/accgyro_spi_bmi160.c +++ b/src/main/drivers/accgyro/accgyro_spi_bmi160.c @@ -267,6 +267,7 @@ extiCallbackRec_t bmi160IntCallbackRec; // Called in ISR context // Gyro read has just completed +#ifdef USE_DMA static busStatus_e bmi160Intcallback(uint32_t arg) { gyroDev_t *gyro = (gyroDev_t *)arg; @@ -280,6 +281,7 @@ static busStatus_e bmi160Intcallback(uint32_t arg) return BUS_READY; } +#endif static void bmi160ExtiHandler(extiCallbackRec_t *cb) { diff --git a/src/main/drivers/accgyro/accgyro_spi_bmi270.c b/src/main/drivers/accgyro/accgyro_spi_bmi270.c index f13f39c75f..a64cfa64b4 100644 --- a/src/main/drivers/accgyro/accgyro_spi_bmi270.c +++ b/src/main/drivers/accgyro/accgyro_spi_bmi270.c @@ -278,6 +278,7 @@ extiCallbackRec_t bmi270IntCallbackRec; */ // Called in ISR context // Gyro read has just completed +#ifdef USE_DMA static busStatus_e bmi270Intcallback(uint32_t arg) { gyroDev_t *gyro = (gyroDev_t *)arg; @@ -291,6 +292,7 @@ static busStatus_e bmi270Intcallback(uint32_t arg) return BUS_READY; } +#endif static void bmi270ExtiHandler(extiCallbackRec_t *cb) { diff --git a/src/main/drivers/dshot.h b/src/main/drivers/dshot.h index 19105b0659..609fc22892 100644 --- a/src/main/drivers/dshot.h +++ b/src/main/drivers/dshot.h @@ -95,6 +95,8 @@ uint16_t prepareDshotPacket(dshotProtocolControl_t *pcb); extern bool useDshotTelemetry; extern uint8_t dshotMotorCount; +bool dshotPwmDevInit(motorDevice_t *device, const motorDevConfig_t *motorConfig); + #ifdef USE_DSHOT_TELEMETRY typedef struct dshotTelemetryMotorState_s { @@ -113,7 +115,6 @@ typedef struct dshotTelemetryState_s { dshotRawValueState_t rawValueState; } dshotTelemetryState_t; -#ifdef USE_DSHOT_TELEMETRY extern uint32_t readDoneCount; FAST_DATA_ZERO_INIT extern uint32_t inputStampUs; @@ -125,10 +126,6 @@ typedef struct dshotTelemetryCycleCounters_s { FAST_DATA_ZERO_INIT extern dshotTelemetryCycleCounters_t dshotDMAHandlerCycleCounters; -#endif - -bool dshotPwmDevInit(motorDevice_t *device, const motorDevConfig_t *motorConfig); - extern dshotTelemetryState_t dshotTelemetryState; #ifdef USE_DSHOT_TELEMETRY_STATS diff --git a/src/main/drivers/dshot_command.c b/src/main/drivers/dshot_command.c index a2fa5da17c..fc95dbc3aa 100644 --- a/src/main/drivers/dshot_command.c +++ b/src/main/drivers/dshot_command.c @@ -216,9 +216,11 @@ void dshotCommandWrite(uint8_t index, uint8_t motorCount, uint8_t command, dshot } if (commandType == DSHOT_CMD_TYPE_BLOCKING) { +#if defined(USE_DSHOT) && defined(USE_DSHOT_TELEMETRY) bool isBitbangActive = false; #ifdef USE_DSHOT_BITBANG isBitbangActive = isDshotBitbangActive(&motorConfig()->dev); +#endif #endif // Fake command in queue. Blocking commands are launched from cli, and no inline commands are running for (uint8_t i = 0; i < motorDeviceCount(); i++) { diff --git a/src/main/msp/msp.c b/src/main/msp/msp.c index de6d7d2492..3087069b9d 100644 --- a/src/main/msp/msp.c +++ b/src/main/msp/msp.c @@ -255,6 +255,7 @@ static void mspEscPassthroughFn(serialPort_t *serialPort) } #endif +#ifdef USE_SERIAL_PASSTHROUGH static serialPort_t *mspFindPassthroughSerialPort(void) { serialPortUsage_t *portUsage = NULL; @@ -284,9 +285,13 @@ static void mspSerialPassthroughFn(serialPort_t *serialPort) serialPassthrough(passthroughPort, serialPort, NULL, NULL); } } +#endif static void mspFcSetPassthroughCommand(sbuf_t *dst, sbuf_t *src, mspPostProcessFnPtr *mspPostProcessFn) { +#ifndef USE_SERIAL_PASSTHROUGH + UNUSED(mspPostProcessFn); +#endif const unsigned int dataSize = sbufBytesRemaining(src); if (dataSize == 0) { // Legacy format @@ -297,6 +302,7 @@ static void mspFcSetPassthroughCommand(sbuf_t *dst, sbuf_t *src, mspPostProcessF } switch (mspPassthroughMode) { +#ifdef USE_SERIAL_PASSTHROUGH case MSP_PASSTHROUGH_SERIAL_ID: case MSP_PASSTHROUGH_SERIAL_FUNCTION_ID: if (mspFindPassthroughSerialPort()) { @@ -308,6 +314,7 @@ static void mspFcSetPassthroughCommand(sbuf_t *dst, sbuf_t *src, mspPostProcessF sbufWriteU8(dst, 0); } break; +#endif #ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE case MSP_PASSTHROUGH_ESC_4WAY: // get channel number