diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/ARMCM4-STM32F407-DISCOVERY/Makefile | 15 | ||||
-rw-r--r-- | demos/ARMCM4-STM32F407-DISCOVERY/chconf.h | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/Makefile b/demos/ARMCM4-STM32F407-DISCOVERY/Makefile index 975e5f999..0f32eeceb 100644 --- a/demos/ARMCM4-STM32F407-DISCOVERY/Makefile +++ b/demos/ARMCM4-STM32F407-DISCOVERY/Makefile @@ -5,7 +5,7 @@ # Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -mhard-float -mfpu=fpv4-sp-d16 -fsingle-precision-constant
+ USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
@@ -41,6 +41,12 @@ endif # Architecture or project specific options
#
+# Enables the use of FPU on Cortex-M4.
+# Enable this if you really want to use the STM FWLib.
+ifeq ($(USE_FPU),)
+ USE_FPU = no
+endif
+
# Enable this if you really want to use the STM FWLib.
ifeq ($(USE_FWLIB),)
USE_FWLIB = no
@@ -200,6 +206,13 @@ ULIBS = # End of user defines
##############################################################################
+ifeq ($(USE_FPU),yes)
+ USE_OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant
+ DDEFS += -DCORTEX_USE_FPU=TRUE
+else
+ DDEFS += -DCORTEX_USE_FPU=FALSE
+endif
+
ifeq ($(USE_FWLIB),yes)
include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
CSRC += $(STM32SRC)
diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/chconf.h b/demos/ARMCM4-STM32F407-DISCOVERY/chconf.h index 3c69cee76..b1f2cd62c 100644 --- a/demos/ARMCM4-STM32F407-DISCOVERY/chconf.h +++ b/demos/ARMCM4-STM32F407-DISCOVERY/chconf.h @@ -530,8 +530,6 @@ /* Port-specific settings (override port settings defaulted in chcore.h). */
/*===========================================================================*/
-#define CORTEX_USE_FPU FALSE
-
#endif /* _CHCONF_H_ */
/** @} */
|