summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/samd/Makefile16
-rw-r--r--ports/samd/mcu/samd21/mpconfigmcu.h (renamed from ports/samd/boards/mpconfig_samd21.h)0
-rw-r--r--ports/samd/mcu/samd21/mpconfigmcu.mk1
-rw-r--r--ports/samd/mcu/samd51/mpconfigmcu.h (renamed from ports/samd/boards/mpconfig_samd51.h)0
-rw-r--r--ports/samd/mcu/samd51/mpconfigmcu.mk1
-rw-r--r--ports/samd/mpconfigport.h2
6 files changed, 8 insertions, 12 deletions
diff --git a/ports/samd/Makefile b/ports/samd/Makefile
index 43b6a1adc..1455e748c 100644
--- a/ports/samd/Makefile
+++ b/ports/samd/Makefile
@@ -9,14 +9,15 @@ ifeq ($(wildcard $(BOARD_DIR)/.),)
$(error Invalid BOARD specified: $(BOARD_DIR))
endif
+MCU_SERIES_LOWER = $(shell echo $(MCU_SERIES) | tr '[:upper:]' '[:lower:]')
+
include ../../py/mkenv.mk
include $(BOARD_DIR)/mpconfigboard.mk
+include mcu/$(MCU_SERIES_LOWER)/mpconfigmcu.mk
# Qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h
-QSTR_GLOBAL_DEPENDENCIES = $(BOARD_DIR)/mpconfigboard.h
-
-MCU_SERIES_LOWER = $(shell echo $(MCU_SERIES) | tr '[:upper:]' '[:lower:]')
+QSTR_GLOBAL_DEPENDENCIES = $(BOARD_DIR)/mpconfigboard.h mcu/$(MCU_SERIES_LOWER)/mpconfigmcu.h
FROZEN_MANIFEST ?= boards/manifest.py
@@ -30,6 +31,7 @@ INC += -I.
INC += -I$(TOP)
INC += -I$(BUILD)
INC += -I$(BOARD_DIR)
+INC += -Imcu/$(MCU_SERIES_LOWER)
INC += -I$(TOP)/lib/cmsis/inc
INC += -I$(TOP)/lib/asf4/$(MCU_SERIES_LOWER)/hal/include
INC += -I$(TOP)/lib/asf4/$(MCU_SERIES_LOWER)/hal/utils/include
@@ -62,8 +64,6 @@ CFLAGS += $(CFLAGS_MOD) $(CFLAGS_EXTRA)
CFLAGS += -DMPCONFIG_MCU_H='<boards/mpconfig_$(MCU_SERIES_LOWER).h>'
CFLAGS += -DPIN_AF_TABLE_C='<$(BUILD)/$(GEN_PIN_AF)>'
-QSTR_GLOBAL_DEPENDENCIES += boards/mpconfig_$(MCU_SERIES_LOWER).h
-
LDFLAGS = -nostdlib $(addprefix -T,$(LD_FILES)) -Map=$@.map --cref
LDFLAGS += $(LDFLAGS_MOD)
@@ -141,12 +141,6 @@ SRC_C += $(SRC_MOD)
SRC_CXX += $(SRC_MOD_CXX)
-ifeq ($(MCU_SERIES),SAMD21)
-SRC_S = shared/runtime/gchelper_m0.s
-else
-SRC_S = shared/runtime/gchelper_m3.s
-endif
-
# List of sources for qstr extraction
SRC_QSTR += \
machine_adc.c \
diff --git a/ports/samd/boards/mpconfig_samd21.h b/ports/samd/mcu/samd21/mpconfigmcu.h
index 587f3f4b3..587f3f4b3 100644
--- a/ports/samd/boards/mpconfig_samd21.h
+++ b/ports/samd/mcu/samd21/mpconfigmcu.h
diff --git a/ports/samd/mcu/samd21/mpconfigmcu.mk b/ports/samd/mcu/samd21/mpconfigmcu.mk
new file mode 100644
index 000000000..cc435da8c
--- /dev/null
+++ b/ports/samd/mcu/samd21/mpconfigmcu.mk
@@ -0,0 +1 @@
+SRC_S += shared/runtime/gchelper_m0.s
diff --git a/ports/samd/boards/mpconfig_samd51.h b/ports/samd/mcu/samd51/mpconfigmcu.h
index 95fc635e5..95fc635e5 100644
--- a/ports/samd/boards/mpconfig_samd51.h
+++ b/ports/samd/mcu/samd51/mpconfigmcu.h
diff --git a/ports/samd/mcu/samd51/mpconfigmcu.mk b/ports/samd/mcu/samd51/mpconfigmcu.mk
new file mode 100644
index 000000000..461a0182e
--- /dev/null
+++ b/ports/samd/mcu/samd51/mpconfigmcu.mk
@@ -0,0 +1 @@
+SRC_S += shared/runtime/gchelper_m3.s
diff --git a/ports/samd/mpconfigport.h b/ports/samd/mpconfigport.h
index 48631080d..8a067d348 100644
--- a/ports/samd/mpconfigport.h
+++ b/ports/samd/mpconfigport.h
@@ -29,7 +29,7 @@
// Board specific definitions
#include "mpconfigboard.h"
// MCU-Specific definitions
-#include MPCONFIG_MCU_H
+#include "mpconfigmcu.h"
// Memory allocation policies
#define MICROPY_GC_STACK_ENTRY_TYPE uint16_t