samd/mcu: Factor out MCU policy for SAMD21 and SAMD51.
Which contains a mpconfigmcu.h, mpconfigmcu.mk and manifest.py file for each MCU group. That looks better than the previous choice.
This commit is contained in:
parent
029e9af457
commit
aa6dbbcffd
@ -9,14 +9,15 @@ ifeq ($(wildcard $(BOARD_DIR)/.),)
|
|||||||
$(error Invalid BOARD specified: $(BOARD_DIR))
|
$(error Invalid BOARD specified: $(BOARD_DIR))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
MCU_SERIES_LOWER = $(shell echo $(MCU_SERIES) | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
include ../../py/mkenv.mk
|
include ../../py/mkenv.mk
|
||||||
include $(BOARD_DIR)/mpconfigboard.mk
|
include $(BOARD_DIR)/mpconfigboard.mk
|
||||||
|
include mcu/$(MCU_SERIES_LOWER)/mpconfigmcu.mk
|
||||||
|
|
||||||
# Qstr definitions (must come before including py.mk)
|
# Qstr definitions (must come before including py.mk)
|
||||||
QSTR_DEFS = qstrdefsport.h
|
QSTR_DEFS = qstrdefsport.h
|
||||||
QSTR_GLOBAL_DEPENDENCIES = $(BOARD_DIR)/mpconfigboard.h
|
QSTR_GLOBAL_DEPENDENCIES = $(BOARD_DIR)/mpconfigboard.h mcu/$(MCU_SERIES_LOWER)/mpconfigmcu.h
|
||||||
|
|
||||||
MCU_SERIES_LOWER = $(shell echo $(MCU_SERIES) | tr '[:upper:]' '[:lower:]')
|
|
||||||
|
|
||||||
FROZEN_MANIFEST ?= boards/manifest.py
|
FROZEN_MANIFEST ?= boards/manifest.py
|
||||||
|
|
||||||
@ -30,6 +31,7 @@ INC += -I.
|
|||||||
INC += -I$(TOP)
|
INC += -I$(TOP)
|
||||||
INC += -I$(BUILD)
|
INC += -I$(BUILD)
|
||||||
INC += -I$(BOARD_DIR)
|
INC += -I$(BOARD_DIR)
|
||||||
|
INC += -Imcu/$(MCU_SERIES_LOWER)
|
||||||
INC += -I$(TOP)/lib/cmsis/inc
|
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/include
|
||||||
INC += -I$(TOP)/lib/asf4/$(MCU_SERIES_LOWER)/hal/utils/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 += -DMPCONFIG_MCU_H='<boards/mpconfig_$(MCU_SERIES_LOWER).h>'
|
||||||
CFLAGS += -DPIN_AF_TABLE_C='<$(BUILD)/$(GEN_PIN_AF)>'
|
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 = -nostdlib $(addprefix -T,$(LD_FILES)) -Map=$@.map --cref
|
||||||
LDFLAGS += $(LDFLAGS_MOD)
|
LDFLAGS += $(LDFLAGS_MOD)
|
||||||
|
|
||||||
@ -141,12 +141,6 @@ SRC_C += $(SRC_MOD)
|
|||||||
|
|
||||||
SRC_CXX += $(SRC_MOD_CXX)
|
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
|
# List of sources for qstr extraction
|
||||||
SRC_QSTR += \
|
SRC_QSTR += \
|
||||||
machine_adc.c \
|
machine_adc.c \
|
||||||
|
|||||||
1
ports/samd/mcu/samd21/mpconfigmcu.mk
Normal file
1
ports/samd/mcu/samd21/mpconfigmcu.mk
Normal file
@ -0,0 +1 @@
|
|||||||
|
SRC_S += shared/runtime/gchelper_m0.s
|
||||||
1
ports/samd/mcu/samd51/mpconfigmcu.mk
Normal file
1
ports/samd/mcu/samd51/mpconfigmcu.mk
Normal file
@ -0,0 +1 @@
|
|||||||
|
SRC_S += shared/runtime/gchelper_m3.s
|
||||||
@ -29,7 +29,7 @@
|
|||||||
// Board specific definitions
|
// Board specific definitions
|
||||||
#include "mpconfigboard.h"
|
#include "mpconfigboard.h"
|
||||||
// MCU-Specific definitions
|
// MCU-Specific definitions
|
||||||
#include MPCONFIG_MCU_H
|
#include "mpconfigmcu.h"
|
||||||
|
|
||||||
// Memory allocation policies
|
// Memory allocation policies
|
||||||
#define MICROPY_GC_STACK_ENTRY_TYPE uint16_t
|
#define MICROPY_GC_STACK_ENTRY_TYPE uint16_t
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user