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:
Damien George 2024-06-13 13:23:43 +10:00
parent daa948fe05
commit 81b1bfcfef
16 changed files with 28 additions and 54 deletions

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
MICROPY_FLOAT_IMPL = double

View File

@ -0,0 +1,2 @@
MICROPY_FLOAT_IMPL = double
CFLAGS += -DMICROPY_PY_THREAD=1

View File

@ -0,0 +1 @@
MICROPY_PY_NETWORK_WIZNET5K = 5200

View File

@ -0,0 +1 @@
CFLAGS += -DMICROPY_PY_THREAD=1

View File

@ -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

View File

@ -0,0 +1 @@
MICROPY_FLOAT_IMPL = double

View File

@ -0,0 +1,2 @@
MICROPY_FLOAT_IMPL = double
CFLAGS += -DMICROPY_PY_THREAD=1

View File

@ -0,0 +1 @@
MICROPY_PY_NETWORK_WIZNET5K = 5200

View File

@ -0,0 +1 @@
CFLAGS += -DMICROPY_PY_THREAD=1

View File

@ -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

View File

@ -0,0 +1 @@
MICROPY_FLOAT_IMPL = double

View File

@ -0,0 +1,2 @@
MICROPY_FLOAT_IMPL = double
CFLAGS += -DMICROPY_PY_THREAD=1

View File

@ -0,0 +1 @@
MICROPY_PY_NETWORK_WIZNET5K = 5200

View File

@ -0,0 +1 @@
CFLAGS += -DMICROPY_PY_THREAD=1