Browse Source

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>
pull/15336/head
Damien George 5 months ago
parent
commit
81b1bfcfef
  1. 13
      ports/stm32/Makefile
  2. 18
      ports/stm32/boards/PYBLITEV10/mpconfigboard.mk
  3. 1
      ports/stm32/boards/PYBLITEV10/mpconfigvariant_DP.mk
  4. 2
      ports/stm32/boards/PYBLITEV10/mpconfigvariant_DP_THREAD.mk
  5. 1
      ports/stm32/boards/PYBLITEV10/mpconfigvariant_NETWORK.mk
  6. 1
      ports/stm32/boards/PYBLITEV10/mpconfigvariant_THREAD.mk
  7. 18
      ports/stm32/boards/PYBV10/mpconfigboard.mk
  8. 1
      ports/stm32/boards/PYBV10/mpconfigvariant_DP.mk
  9. 2
      ports/stm32/boards/PYBV10/mpconfigvariant_DP_THREAD.mk
  10. 1
      ports/stm32/boards/PYBV10/mpconfigvariant_NETWORK.mk
  11. 1
      ports/stm32/boards/PYBV10/mpconfigvariant_THREAD.mk
  12. 18
      ports/stm32/boards/PYBV11/mpconfigboard.mk
  13. 1
      ports/stm32/boards/PYBV11/mpconfigvariant_DP.mk
  14. 2
      ports/stm32/boards/PYBV11/mpconfigvariant_DP_THREAD.mk
  15. 1
      ports/stm32/boards/PYBV11/mpconfigvariant_NETWORK.mk
  16. 1
      ports/stm32/boards/PYBV11/mpconfigvariant_THREAD.mk

13
ports/stm32/Makefile

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

18
ports/stm32/boards/PYBLITEV10/mpconfigboard.mk

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

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

2
ports/stm32/boards/PYBLITEV10/mpconfigvariant_DP_THREAD.mk

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

1
ports/stm32/boards/PYBLITEV10/mpconfigvariant_NETWORK.mk

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

1
ports/stm32/boards/PYBLITEV10/mpconfigvariant_THREAD.mk

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

18
ports/stm32/boards/PYBV10/mpconfigboard.mk

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

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

2
ports/stm32/boards/PYBV10/mpconfigvariant_DP_THREAD.mk

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

1
ports/stm32/boards/PYBV10/mpconfigvariant_NETWORK.mk

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

1
ports/stm32/boards/PYBV10/mpconfigvariant_THREAD.mk

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

18
ports/stm32/boards/PYBV11/mpconfigboard.mk

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

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

2
ports/stm32/boards/PYBV11/mpconfigvariant_DP_THREAD.mk

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

1
ports/stm32/boards/PYBV11/mpconfigvariant_NETWORK.mk

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

1
ports/stm32/boards/PYBV11/mpconfigvariant_THREAD.mk

@ -0,0 +1 @@
CFLAGS += -DMICROPY_PY_THREAD=1
Loading…
Cancel
Save