stm32: Rework board variant support to require mpconfigvariant file.
Following how the board variants now work in the esp8266 port. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
daa948fe05
commit
81b1bfcfef
@ -13,6 +13,12 @@ ifeq ($(wildcard $(BOARD_DIR)/.),)
|
||||
$(error Invalid BOARD specified: $(BOARD_DIR))
|
||||
endif
|
||||
|
||||
ifneq ($(BOARD_VARIANT),)
|
||||
ifeq ($(wildcard $(BOARD_DIR)/mpconfigvariant_$(BOARD_VARIANT).mk),)
|
||||
$(error Invalid BOARD_VARIANT specified: $(BOARD_VARIANT))
|
||||
endif
|
||||
endif
|
||||
|
||||
# If the build directory is not given, make it reflect the board name (and
|
||||
# optionally the board variant).
|
||||
ifneq ($(BOARD_VARIANT),)
|
||||
@ -23,7 +29,14 @@ endif
|
||||
|
||||
include ../../py/mkenv.mk
|
||||
-include mpconfigport.mk
|
||||
|
||||
# Include board specific .mk file, and optional board variant .mk file.
|
||||
include $(BOARD_DIR)/mpconfigboard.mk
|
||||
ifeq ($(BOARD_VARIANT),)
|
||||
-include $(BOARD_DIR)/mpconfigvariant.mk
|
||||
else
|
||||
include $(BOARD_DIR)/mpconfigvariant_$(BOARD_VARIANT).mk
|
||||
endif
|
||||
|
||||
# qstr definitions (must come before including py.mk)
|
||||
QSTR_DEFS += qstrdefsport.h
|
||||
|
||||
@ -5,23 +5,5 @@ LD_FILES = boards/stm32f411.ld boards/common_ifs.ld
|
||||
TEXT0_ADDR = 0x08000000
|
||||
TEXT1_ADDR = 0x08020000
|
||||
|
||||
# Provide different variants for the downloads page.
|
||||
ifeq ($(BOARD_VARIANT),DP)
|
||||
MICROPY_FLOAT_IMPL=double
|
||||
endif
|
||||
|
||||
ifeq ($(BOARD_VARIANT),THREAD)
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
endif
|
||||
|
||||
ifeq ($(BOARD_VARIANT),DP_THREAD)
|
||||
MICROPY_FLOAT_IMPL=double
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
endif
|
||||
|
||||
ifeq ($(BOARD_VARIANT),NETWORK)
|
||||
MICROPY_PY_NETWORK_WIZNET5K=5200
|
||||
endif
|
||||
|
||||
# PYB-specific frozen modules
|
||||
FROZEN_MANIFEST ?= boards/PYBV10/manifest.py
|
||||
|
||||
1
ports/stm32/boards/PYBLITEV10/mpconfigvariant_DP.mk
Normal file
1
ports/stm32/boards/PYBLITEV10/mpconfigvariant_DP.mk
Normal file
@ -0,0 +1 @@
|
||||
MICROPY_FLOAT_IMPL = double
|
||||
@ -0,0 +1,2 @@
|
||||
MICROPY_FLOAT_IMPL = double
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
1
ports/stm32/boards/PYBLITEV10/mpconfigvariant_NETWORK.mk
Normal file
1
ports/stm32/boards/PYBLITEV10/mpconfigvariant_NETWORK.mk
Normal file
@ -0,0 +1 @@
|
||||
MICROPY_PY_NETWORK_WIZNET5K = 5200
|
||||
1
ports/stm32/boards/PYBLITEV10/mpconfigvariant_THREAD.mk
Normal file
1
ports/stm32/boards/PYBLITEV10/mpconfigvariant_THREAD.mk
Normal file
@ -0,0 +1 @@
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
@ -15,23 +15,5 @@ endif
|
||||
# MicroPython settings
|
||||
MICROPY_VFS_LFS2 = 1
|
||||
|
||||
# Provide different variants for the downloads page.
|
||||
ifeq ($(BOARD_VARIANT),DP)
|
||||
MICROPY_FLOAT_IMPL=double
|
||||
endif
|
||||
|
||||
ifeq ($(BOARD_VARIANT),THREAD)
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
endif
|
||||
|
||||
ifeq ($(BOARD_VARIANT),DP_THREAD)
|
||||
MICROPY_FLOAT_IMPL=double
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
endif
|
||||
|
||||
ifeq ($(BOARD_VARIANT),NETWORK)
|
||||
MICROPY_PY_NETWORK_WIZNET5K=5200
|
||||
endif
|
||||
|
||||
# PYB-specific frozen modules
|
||||
FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
|
||||
|
||||
1
ports/stm32/boards/PYBV10/mpconfigvariant_DP.mk
Normal file
1
ports/stm32/boards/PYBV10/mpconfigvariant_DP.mk
Normal file
@ -0,0 +1 @@
|
||||
MICROPY_FLOAT_IMPL = double
|
||||
2
ports/stm32/boards/PYBV10/mpconfigvariant_DP_THREAD.mk
Normal file
2
ports/stm32/boards/PYBV10/mpconfigvariant_DP_THREAD.mk
Normal file
@ -0,0 +1,2 @@
|
||||
MICROPY_FLOAT_IMPL = double
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
1
ports/stm32/boards/PYBV10/mpconfigvariant_NETWORK.mk
Normal file
1
ports/stm32/boards/PYBV10/mpconfigvariant_NETWORK.mk
Normal file
@ -0,0 +1 @@
|
||||
MICROPY_PY_NETWORK_WIZNET5K = 5200
|
||||
1
ports/stm32/boards/PYBV10/mpconfigvariant_THREAD.mk
Normal file
1
ports/stm32/boards/PYBV10/mpconfigvariant_THREAD.mk
Normal file
@ -0,0 +1 @@
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
@ -15,23 +15,5 @@ endif
|
||||
# MicroPython settings
|
||||
MICROPY_VFS_LFS2 = 1
|
||||
|
||||
# Provide different variants for the downloads page.
|
||||
ifeq ($(BOARD_VARIANT),DP)
|
||||
MICROPY_FLOAT_IMPL=double
|
||||
endif
|
||||
|
||||
ifeq ($(BOARD_VARIANT),THREAD)
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
endif
|
||||
|
||||
ifeq ($(BOARD_VARIANT),DP_THREAD)
|
||||
MICROPY_FLOAT_IMPL=double
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
endif
|
||||
|
||||
ifeq ($(BOARD_VARIANT),NETWORK)
|
||||
MICROPY_PY_NETWORK_WIZNET5K=5200
|
||||
endif
|
||||
|
||||
# PYB-specific frozen modules
|
||||
FROZEN_MANIFEST ?= boards/PYBV10/manifest.py
|
||||
|
||||
1
ports/stm32/boards/PYBV11/mpconfigvariant_DP.mk
Normal file
1
ports/stm32/boards/PYBV11/mpconfigvariant_DP.mk
Normal file
@ -0,0 +1 @@
|
||||
MICROPY_FLOAT_IMPL = double
|
||||
2
ports/stm32/boards/PYBV11/mpconfigvariant_DP_THREAD.mk
Normal file
2
ports/stm32/boards/PYBV11/mpconfigvariant_DP_THREAD.mk
Normal file
@ -0,0 +1,2 @@
|
||||
MICROPY_FLOAT_IMPL = double
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
1
ports/stm32/boards/PYBV11/mpconfigvariant_NETWORK.mk
Normal file
1
ports/stm32/boards/PYBV11/mpconfigvariant_NETWORK.mk
Normal file
@ -0,0 +1 @@
|
||||
MICROPY_PY_NETWORK_WIZNET5K = 5200
|
||||
1
ports/stm32/boards/PYBV11/mpconfigvariant_THREAD.mk
Normal file
1
ports/stm32/boards/PYBV11/mpconfigvariant_THREAD.mk
Normal file
@ -0,0 +1 @@
|
||||
CFLAGS += -DMICROPY_PY_THREAD=1
|
||||
Loading…
x
Reference in New Issue
Block a user