From d95aae46192a893b8eac50d95f385007d626fffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 5 Jul 2019 14:19:33 +0200 Subject: [PATCH] Generic-arm-none-eabi-gcc-cortex-m7: use SP float depending on NuttX config Not all m7 boards support double, as for example the STM32F745. --- .../Platform/Generic-arm-none-eabi-gcc-cortex-m7.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platforms/nuttx/cmake/Platform/Generic-arm-none-eabi-gcc-cortex-m7.cmake b/platforms/nuttx/cmake/Platform/Generic-arm-none-eabi-gcc-cortex-m7.cmake index cf8865074a..b030abd699 100644 --- a/platforms/nuttx/cmake/Platform/Generic-arm-none-eabi-gcc-cortex-m7.cmake +++ b/platforms/nuttx/cmake/Platform/Generic-arm-none-eabi-gcc-cortex-m7.cmake @@ -1,5 +1,12 @@ -set(cpu_flags "-mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard") +if (CONFIG_ARCH_DPFPU) + message(STATUS "Enabling double FP precision hardware instructions") + set(mfpu_type "fpv5-d16") +else() + set(mfpu_type "fpv5-sp-d16") +endif() + +set(cpu_flags "-mcpu=cortex-m7 -mthumb -mfpu=${mfpu_type} -mfloat-abi=hard") set(CMAKE_C_FLAGS "${cpu_flags}" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS "${cpu_flags}" CACHE STRING "" FORCE)