From 2f47ec60571f86110dbbd8657be23e3635d881d3 Mon Sep 17 00:00:00 2001
From: Joakim Gebart <joakim.gebart@eistec.se>
Date: Sat, 30 May 2015 10:02:46 +0200
Subject: [PATCH] cortexm_common: Add CMSIS DSP defines

---
 cpu/Makefile.include.cortexm_common | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/cpu/Makefile.include.cortexm_common b/cpu/Makefile.include.cortexm_common
index cf19ddc278..02794dab30 100644
--- a/cpu/Makefile.include.cortexm_common
+++ b/cpu/Makefile.include.cortexm_common
@@ -27,6 +27,24 @@ endif
 CFLAGS_FPU ?= -mfloat-abi=soft
 export MCPU ?= $(CPU_ARCH)
 
+# CMSIS DSP needs to know about the CPU core
+ifneq (,$(filter cmsis-dsp,$(USEPKG)))
+# definition needed to use cmsis-dsp headers
+ifeq ($(CPU_ARCH),cortex-m0)
+export CFLAGS += -DARM_MATH_CM0
+else ifeq ($(CPU_ARCH),cortex-m0plus)
+export CFLAGS += -DARM_MATH_CM0PLUS
+else ifeq ($(CPU_ARCH),cortex-m3)
+export CFLAGS += -DARM_MATH_CM3
+else ifeq ($(CPU_ARCH),cortex-m4)
+export CFLAGS += -DARM_MATH_CM4
+else ifeq ($(CPU_ARCH),cortex-m4f)
+export CFLAGS += -DARM_MATH_CM4
+else ifeq ($(CPU_ARCH),cortex-m7)
+export CFLAGS += -DARM_MATH_CM7
+endif
+endif
+
 # Include CPU specific includes:
 export INCLUDES += -I$(RIOTCPU)/$(CPU)/include
 
-- 
GitLab