From 78d96cfcea16f28fd67bb8d5520bad11679a8ab6 Mon Sep 17 00:00:00 2001 From: Dan Walkes Date: Sun, 5 Nov 2017 13:14:31 -0700 Subject: [PATCH] Set c compile flags correctly To support projects with C files. Based on settings previous to commit 145219332a057558590256d33569acd8dc305a94 with extra -mthumb setting to match C++ compile flags. With this change to platform.txt file replacing the version at C:\Users\Username\AppData\Local\Arduino15\packages\RedBear\hardware\STM32F2\0.3.1\platform.txt projects containg C files can once again be linked and downloaded successfully to the target device. --- arduino/platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino/platform.txt b/arduino/platform.txt index 8d06744..d4befaf 100755 --- a/arduino/platform.txt +++ b/arduino/platform.txt @@ -19,7 +19,7 @@ recipe.s.o.pattern = "{tools.arm_none_eabi_gcc.path}{tools.arm ###### Compile c files tools.arm_none_eabi_gcc.c.defines = tools.arm_none_eabi_gcc.c.includes = -tools.arm_none_eabi_gcc.c.cflags = +tools.arm_none_eabi_gcc.c.cflags = -c -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -w -std=gnu99 -fno-common -fmessage-length=0 -Wall -fno-exceptions -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -ffunction-sections -fdata-sections -fomit-frame-pointer -nostdlib --param max-inline-insns-single=500 -fno-exceptions -fno-rtti tools.arm_none_eabi_gcc.c.conlyflags = recipe.c.o.pattern = "{tools.arm_none_eabi_gcc.path}{tools.arm_none_eabi_gcc.gcc}" -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} {tools.arm_none_eabi_gcc.c.defines} {includes} {tools.arm_none_eabi_gcc.c.includes} {tools.arm_none_eabi_gcc.c.cflags} {tools.arm_none_eabi_gcc.c.conlyflags} -c -o "{object_file}" "{source_file}"