From c5924f0d04cbca1a5844751b3b399e75436edd56 Mon Sep 17 00:00:00 2001
From: Hauke Petersen <hauke.petersen@fu-berlin.de>
Date: Mon, 8 Feb 2016 18:22:11 +0100
Subject: [PATCH] cpu/sam21: added common dir for sam[l|d]21 CPUs

---
 cpu/sam21_common/Makefile         |  3 +++
 cpu/sam21_common/Makefile.include | 12 ++++++++++++
 cpu/sam21_common/periph/Makefile  |  3 +++
 3 files changed, 18 insertions(+)
 create mode 100644 cpu/sam21_common/Makefile
 create mode 100644 cpu/sam21_common/Makefile.include
 create mode 100644 cpu/sam21_common/periph/Makefile

diff --git a/cpu/sam21_common/Makefile b/cpu/sam21_common/Makefile
new file mode 100644
index 0000000000..e09377cd1e
--- /dev/null
+++ b/cpu/sam21_common/Makefile
@@ -0,0 +1,3 @@
+DIRS = periph
+
+include $(RIOTBASE)/Makefile.base
diff --git a/cpu/sam21_common/Makefile.include b/cpu/sam21_common/Makefile.include
new file mode 100644
index 0000000000..29e2f1d9d6
--- /dev/null
+++ b/cpu/sam21_common/Makefile.include
@@ -0,0 +1,12 @@
+# export the CPU family so we can differentiate between them in the code
+FAM = $(shell echo $(CPU_FAM) | tr 'a-z-' 'A-Z_')
+export CFLAGS += -DCPU_FAM_$(FAM)
+
+# this CPU implementation doesn't use CMSIS initialization
+export CFLAGS += -DDONT_USE_CMSIS_INIT
+
+# use common periph functions
+USEMODULE += periph_common
+
+# export the common include directory
+export INCLUDES += -I$(RIOTCPU)/sam21_common/include
diff --git a/cpu/sam21_common/periph/Makefile b/cpu/sam21_common/periph/Makefile
new file mode 100644
index 0000000000..6d1887b640
--- /dev/null
+++ b/cpu/sam21_common/periph/Makefile
@@ -0,0 +1,3 @@
+MODULE = periph
+
+include $(RIOTBASE)/Makefile.base
-- 
GitLab