aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-05-20 16:28:39 +0100
committerGitHub <noreply@github.com>2020-05-20 16:28:39 +0100
commitb0c780ed32712d2eb38c69a2b9465a00b861381e (patch)
tree500c8c4f797e8a38a49fee8bbafaaf8efd4481c6
parent3ad2be52a7098c269d741f8d59a424afdbd7302d (diff)
downloadqmk_firmware-b0c780ed32712d2eb38c69a2b9465a00b861381e.tar.gz
qmk_firmware-b0c780ed32712d2eb38c69a2b9465a00b861381e.zip
Fix ChibiOS FPU build logic (#9132)
-rw-r--r--tmk_core/chibios.mk28
-rw-r--r--tmk_core/rules.mk2
2 files changed, 13 insertions, 17 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index d0f1032ac..09aaddeef 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -220,6 +220,18 @@ COMPILEFLAGS += -fno-common
220COMPILEFLAGS += -fshort-wchar 220COMPILEFLAGS += -fshort-wchar
221COMPILEFLAGS += $(THUMBFLAGS) 221COMPILEFLAGS += $(THUMBFLAGS)
222 222
223# FPU options default (Cortex-M4 and Cortex-M7 single precision).
224USE_FPU_OPT ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
225
226# FPU-related options
227USE_FPU ?= no
228ifneq ($(USE_FPU),no)
229 COMPILEFLAGS += $(USE_FPU_OPT)
230 OPT_DEFS += -DCORTEX_USE_FPU=TRUE
231else
232 OPT_DEFS += -DCORTEX_USE_FPU=FALSE
233endif
234
223CFLAGS += $(COMPILEFLAGS) 235CFLAGS += $(COMPILEFLAGS)
224 236
225ASFLAGS += $(THUMBFLAGS) 237ASFLAGS += $(THUMBFLAGS)
@@ -241,22 +253,6 @@ OPT_DEFS += -DPORT_IGNORE_GCC_VERSION_CHECK=1
241 253
242MCUFLAGS = -mcpu=$(MCU) 254MCUFLAGS = -mcpu=$(MCU)
243 255
244# FPU options default (Cortex-M4 and Cortex-M7 single precision).
245ifeq ($(USE_FPU_OPT),)
246 USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 -fsingle-precision-constant
247endif
248
249# FPU-related options
250ifeq ($(USE_FPU),)
251 USE_FPU = no
252endif
253ifneq ($(USE_FPU),no)
254 OPT += $(USE_FPU_OPT)
255 OPT_DEFS += -DCORTEX_USE_FPU=TRUE
256else
257 OPT_DEFS += -DCORTEX_USE_FPU=FALSE
258endif
259
260DEBUG = gdb 256DEBUG = gdb
261 257
262DFU_ARGS ?= 258DFU_ARGS ?=
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index f45fd3792..9bb341ecb 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -46,7 +46,7 @@ FORMAT = ihex
46# Optimization level, can be [0, 1, 2, 3, s]. 46# Optimization level, can be [0, 1, 2, 3, s].
47# 0 = turn off optimization. s = optimize for size. 47# 0 = turn off optimization. s = optimize for size.
48# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) 48# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
49OPT = s 49OPT ?= s
50 50
51# Compiler flag to set the C Standard level. 51# Compiler flag to set the C Standard level.
52# c89 = "ANSI" C 52# c89 = "ANSI" C