Skip to content

Commit

Permalink
samd51/Makefile: Change the variant support to dedicated .mk files.
Browse files Browse the repository at this point in the history
That simplifies each of these files.

Signed-off-by: robert-hh <robert@hammelrath.com>
  • Loading branch information
robert-hh committed Sep 12, 2024
1 parent 842848a commit 33661f5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ports/samd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,20 @@ UF2CONV ?= $(TOP)/tools/uf2conv.py
MCU_SERIES_LOWER = $(shell echo $(MCU_SERIES) | tr '[:upper:]' '[:lower:]')

include ../../py/mkenv.mk

# Include board and MCU specific .mk files, and optional board variant .mk file.
include $(BOARD_DIR)/mpconfigboard.mk
include mcu/$(MCU_SERIES_LOWER)/mpconfigmcu.mk

ifeq ($(BOARD_VARIANT),)
-include mcu/$(MCU_SERIES_LOWER)/mpconfigvariant.mk
else
ifeq ($(wildcard mcu/$(MCU_SERIES_LOWER)/mpconfigvariant_$(BOARD_VARIANT).mk),)
$(error Invalid BOARD_VARIANT specified: $(BOARD_VARIANT))
endif
include mcu/$(MCU_SERIES_LOWER)/mpconfigvariant_$(BOARD_VARIANT).mk
endif

# Qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h
QSTR_GLOBAL_DEPENDENCIES = $(BOARD_DIR)/mpconfigboard.h mcu/$(MCU_SERIES_LOWER)/mpconfigmcu.h
Expand Down
16 changes: 16 additions & 0 deletions ports/samd/mcu/samd51/mpconfigvariant_WLAN.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
MICROPY_PY_NETWORK = 1
CFLAGS += -DMICROPY_PY_NETWORK=1
MICROPY_PY_NETWORK_ESP_HOSTED = 1
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1

SRC_C += \
esp_hosted_hal.c \
mpbthciport.c \
mpnimbleport.c \
mpnetworkport.c \
mbedtls/mbedtls_port.c

INC += \
-Ilwip_inc
24 changes: 24 additions & 0 deletions ports/samd/mcu/samd51/mpconfigvariant_WLAN_BLE.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MICROPY_PY_NETWORK = 1
CFLAGS += -DMICROPY_PY_NETWORK=1
MICROPY_PY_NETWORK_ESP_HOSTED = 1
MICROPY_PY_LWIP = 1

ifeq ($(MICROPY_HW_CODESIZE), 1008K)
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
endif

MICROPY_PY_BLUETOOTH = 1
CFLAGS += -DMICROPY_PY_BLUETOOTH=$(MICROPY_PY_BLUETOOTH)
MICROPY_BLUETOOTH_NIMBLE = 1
MICROPY_BLUETOOTH_BTSTACK = 0

SRC_C += \
esp_hosted_hal.c \
mpbthciport.c \
mpnimbleport.c \
mpnetworkport.c \
mbedtls/mbedtls_port.c

INC += \
-Ilwip_inc

0 comments on commit 33661f5

Please sign in to comment.