From 7b8ebfc8f995ce6cb2f1474241ba5d2bf4ca7d7f Mon Sep 17 00:00:00 2001 From: borisbstyle Date: Wed, 2 Nov 2016 22:22:51 +0100 Subject: [PATCH] Disable -flto optimiser option for F3, F4 and F7 --- Makefile | 4 ++++ src/main/common/filter.c | 2 +- src/main/drivers/pwm_output.c | 2 +- src/main/telemetry/smartport.c | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fa5bed9106..c6ccb2b20f 100644 --- a/Makefile +++ b/Makefile @@ -734,7 +734,11 @@ 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/common/filter.c b/src/main/common/filter.c index 98d82919e4..6fdf6e5c59 100644 --- a/src/main/common/filter.c +++ b/src/main/common/filter.c @@ -75,7 +75,7 @@ void biquadFilterInit(biquadFilter_t *filter, float filterFreq, uint32_t refresh const float cs = cosf(omega); const float alpha = sn / (2 * Q); - float b0, b1, b2, a0, a1, a2; + float b0 = 0, b1 = 0, b2 = 0, a0 = 0, a1 = 0, a2 = 0; switch (filterType) { case FILTER_LPF: diff --git a/src/main/drivers/pwm_output.c b/src/main/drivers/pwm_output.c index 59f01726bb..ea28c3e48e 100644 --- a/src/main/drivers/pwm_output.c +++ b/src/main/drivers/pwm_output.c @@ -156,7 +156,7 @@ void pwmCompleteMotorUpdate(uint8_t motorCount) void motorInit(const motorConfig_t *motorConfig, uint16_t idlePulse, uint8_t motorCount) { - uint32_t timerMhzCounter; + uint32_t timerMhzCounter = 0; pwmWriteFuncPtr pwmWritePtr; bool useUnsyncedPwm = motorConfig->useUnsyncedPwm; bool isDigital = false; diff --git a/src/main/telemetry/smartport.c b/src/main/telemetry/smartport.c index 02fdbac1ae..c9be67089c 100644 --- a/src/main/telemetry/smartport.c +++ b/src/main/telemetry/smartport.c @@ -620,7 +620,7 @@ void handleSmartPortTelemetry(void) smartPortIdCnt++; int32_t tmpi; - uint32_t tmp2; + uint32_t tmp2 = 0; static uint8_t t1Cnt = 0; static uint8_t t2Cnt = 0;