From 1f2ef98042c36cb3cdbe91e92e40566bb8c16e6e Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Tue, 11 Jun 2019 18:35:59 +0200 Subject: [PATCH] Fix compilation when USE_DSHOT and USE_PWM_OUTPUT are not defined. Fix compilation when USE_DMA and USE_DMA_SPEC are not defined. Cleanup calling code of `isMotorProtocolDshot`. Fix 'unused' warning when USE_PWM_OUTPUT is not defined. Undo isMotoroProtocolDshot change. Disable USE_SERIAL_4WAY_BLHELI_INTERFACE when USE_PWM_OUTPUT is not enabled. Style cleanup. --- src/main/cli/cli.c | 11 ++++++++++ src/main/drivers/pwm_output.c | 4 ++-- src/main/drivers/rx/rx_pwm.c | 4 ++++ src/main/flight/mixer.c | 38 +++++++++++++++++++++-------------- src/main/msp/msp_box.c | 2 ++ src/main/target/SITL/target.c | 5 ----- src/main/target/common_post.h | 4 ++++ 7 files changed, 46 insertions(+), 22 deletions(-) diff --git a/src/main/cli/cli.c b/src/main/cli/cli.c index c8505c94d6..b5a2017b52 100644 --- a/src/main/cli/cli.c +++ b/src/main/cli/cli.c @@ -4868,6 +4868,7 @@ static bool strToPin(char *pch, ioTag_t *tag) return false; } +#ifdef USE_DMA static void printDma(void) { cliPrintLinefeed(); @@ -4891,6 +4892,7 @@ static void printDma(void) } } } +#endif #ifdef USE_DMA_SPEC @@ -5274,6 +5276,7 @@ static void cliDmaopt(char *cmdline) } #endif // USE_DMA_SPEC +#ifdef USE_DMA static void cliDma(char* cmdline) { int len = strlen(cmdline); @@ -5289,6 +5292,8 @@ static void cliDma(char* cmdline) cliShowParseError(); #endif } +#endif + static void cliResource(char *cmdline) { @@ -5318,10 +5323,12 @@ static void cliResource(char *cmdline) cliPrintLinefeed(); } +#if defined(USE_DMA) pch = strtok_r(NULL, " ", &saveptr); if (strcasecmp(pch, "all") == 0) { cliDma("show"); } +#endif return; } @@ -5972,11 +5979,15 @@ const clicmd_t cmdTable[] = { CLI_COMMAND_DEF("defaults", "reset to defaults and reboot", "[nosave]", cliDefaults), CLI_COMMAND_DEF("diff", "list configuration changes from default", "[master|profile|rates|hardware|all] {defaults|bare}", cliDiff), #ifdef USE_RESOURCE_MGMT + +#ifdef USE_DMA #ifdef USE_DMA_SPEC CLI_COMMAND_DEF("dma", "show/set DMA assignments", "<> | list | [