summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-06-23 16:47:36 +1000
committerDamien George <damien.p.george@gmail.com>2017-06-28 15:12:05 +1000
commit535804a0ed18c1842e3a01f1f5cf995ae4afe513 (patch)
treeb60ba0a33514829b1b61e2458e5b1637a4457bf4
parentd20f8fb893467b64fed7230ee885821c2befc20a (diff)
downloadmicropython-535804a0ed18c1842e3a01f1f5cf995ae4afe513.tar.gz
micropython-535804a0ed18c1842e3a01f1f5cf995ae4afe513.zip
stmhal/Makefile: Use hardware double-prec FP for MCUs that support it.
-rw-r--r--stmhal/Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/stmhal/Makefile b/stmhal/Makefile
index ec41f30dbc..b7226c463b 100644
--- a/stmhal/Makefile
+++ b/stmhal/Makefile
@@ -48,7 +48,17 @@ INC += -I$(HAL_DIR)/inc
INC += -I$(USBDEV_DIR)/core/inc -I$(USBDEV_DIR)/class/inc
#INC += -I$(USBHOST_DIR)
-CFLAGS_CORTEX_M = -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard
+# Basic Cortex-M flags
+CFLAGS_CORTEX_M = -mthumb
+
+# Select hardware floating-point support
+ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),STM32F767xx STM32F769xx))
+CFLAGS_CORTEX_M += -mfpu=fpv5-d16 -mfloat-abi=hard
+else
+CFLAGS_CORTEX_M += -mfpu=fpv4-sp-d16 -mfloat-abi=hard
+endif
+
+# Options for particular MCU series
CFLAGS_MCU_f4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 -DMCU_SERIES_F4
CFLAGS_MCU_f7 = $(CFLAGS_CORTEX_M) -mtune=cortex-m7 -mcpu=cortex-m7 -DMCU_SERIES_F7
CFLAGS_MCU_l4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 -DMCU_SERIES_L4