From 93d25662877145679e15b5b330e582acfdeb0922 Mon Sep 17 00:00:00 2001 From: Mikolaj Stawiski <26871388+stawiski@users.noreply.github.com> Date: Wed, 20 Mar 2019 19:47:18 +1100 Subject: [PATCH 1/2] Fixed warnings. --- src/main/drivers/pwm_output_dshot.c | 4 ++-- src/main/msc/emfat_file.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/drivers/pwm_output_dshot.c b/src/main/drivers/pwm_output_dshot.c index 50bee313e8..ec4d3cd732 100644 --- a/src/main/drivers/pwm_output_dshot.c +++ b/src/main/drivers/pwm_output_dshot.c @@ -216,9 +216,9 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m #define DMAINIT dmaInitStruct #endif - dmaStream_t *dmaRef; + dmaStream_t *dmaRef = NULL; #if defined(STM32F4) - uint32_t dmaChannel; + uint32_t dmaChannel = 0; #endif #if defined(USE_DMA_SPEC) const dmaChannelSpec_t *dmaSpec = dmaGetChannelSpecByTimer(timerHardware); diff --git a/src/main/msc/emfat_file.c b/src/main/msc/emfat_file.c index c1d5d69dc1..20ef7bc5ca 100644 --- a/src/main/msc/emfat_file.c +++ b/src/main/msc/emfat_file.c @@ -296,9 +296,9 @@ static void emfat_add_log(emfat_entry_t *entry, int number, uint32_t offset, uin static int emfat_find_log(emfat_entry_t *entry, int maxCount) { - uint32_t limit = flashfsIdentifyStartOfFreeSpace(); - uint32_t lastOffset = 0; - uint32_t currOffset = 0; + int limit = flashfsIdentifyStartOfFreeSpace(); + int lastOffset = 0; + int currOffset = 0; int fileNumber = 0; uint8_t buffer[18]; int logCount = 0; From 013a1d1b286fd8a834223f52b8762a8608c8d6e3 Mon Sep 17 00:00:00 2001 From: Mikolaj Stawiski <26871388+stawiski@users.noreply.github.com> Date: Wed, 27 Mar 2019 20:47:34 +1100 Subject: [PATCH 2/2] Fixed more warnings that only happened for F7 targets. --- src/main/drivers/pwm_output_dshot_hal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/drivers/pwm_output_dshot_hal.c b/src/main/drivers/pwm_output_dshot_hal.c index 7c79f13084..745ec69362 100644 --- a/src/main/drivers/pwm_output_dshot_hal.c +++ b/src/main/drivers/pwm_output_dshot_hal.c @@ -200,8 +200,8 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m #define DMAINIT dmaInitStruct #endif - DMA_Stream_TypeDef *dmaRef; - uint32_t dmaChannel; + DMA_Stream_TypeDef *dmaRef = NULL; + uint32_t dmaChannel = 0; #if defined(USE_DMA_SPEC) const dmaChannelSpec_t *dmaSpec = dmaGetChannelSpecByTimer(timerHardware); @@ -286,7 +286,7 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m motor->icInitStruct.ICFilter = 0; //2; #endif - uint32_t channel; + uint32_t channel = 0; switch (timerHardware->channel) { case TIM_CHANNEL_1: channel = LL_TIM_CHANNEL_CH1; break; case TIM_CHANNEL_2: channel = LL_TIM_CHANNEL_CH2; break;