From 7100454a1d26582e9830056600c3d4b015c36b4c Mon Sep 17 00:00:00 2001 From: borisbstyle Date: Thu, 3 Nov 2016 23:40:34 +0100 Subject: [PATCH] Fix DMA bug on F3 // enable flto again (Thanks to @ronlix for the find) --- Makefile | 4 ---- src/main/drivers/pwm_output_stm32f3xx.c | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c6ccb2b20..fa5bed910 100644 --- a/Makefile +++ b/Makefile @@ -734,11 +734,7 @@ OPTIMIZE = -O0 LTO_FLAGS = $(OPTIMIZE) else OPTIMIZE = -Os -ifeq ($(TARGET),$(filter $(TARGET),$(F1_TARGETS))) LTO_FLAGS = -flto -fuse-linker-plugin $(OPTIMIZE) -else -LTO_FLAGS = -fuse-linker-plugin $(OPTIMIZE) -endif endif DEBUG_FLAGS = -ggdb3 -DDEBUG diff --git a/src/main/drivers/pwm_output_stm32f3xx.c b/src/main/drivers/pwm_output_stm32f3xx.c index e72e03234..0813b76fb 100644 --- a/src/main/drivers/pwm_output_stm32f3xx.c +++ b/src/main/drivers/pwm_output_stm32f3xx.c @@ -139,6 +139,7 @@ void pwmDigitalMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t TIM_TimeBaseStructure.TIM_Prescaler = (uint16_t)((SystemCoreClock / timerClockDivisor(timer) / hz) - 1); TIM_TimeBaseStructure.TIM_Period = MOTOR_BITLENGTH; TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; + TIM_TimeBaseStructure.TIM_RepetitionCounter = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseInit(timer, &TIM_TimeBaseStructure); }