1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

Allow for builds with certain features disabled. (#14420)

* Allow for builds with certain features disabled.

Fix build for when the following are disabled:
 USE_DMA
 USE_DSHOT_TELEMETRY
 USE_SERIAL_PASSTHROUGH

* Tweak #ifdef / UNUSED as per code review.
This commit is contained in:
mjs1441 2025-06-04 15:39:45 +01:00 committed by GitHub
parent f4786d1569
commit 8853356e71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 5 deletions

View file

@ -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,6 +285,7 @@ static void mspSerialPassthroughFn(serialPort_t *serialPort)
serialPassthrough(passthroughPort, serialPort, NULL, NULL);
}
}
#endif
static void mspFcSetPassthroughCommand(sbuf_t *dst, sbuf_t *src, mspPostProcessFnPtr *mspPostProcessFn)
{
@ -297,6 +299,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 +311,9 @@ static void mspFcSetPassthroughCommand(sbuf_t *dst, sbuf_t *src, mspPostProcessF
sbufWriteU8(dst, 0);
}
break;
#else
UNUSED(mspPostProcessFn);
#endif
#ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE
case MSP_PASSTHROUGH_ESC_4WAY:
// get channel number