Skip to content

Commit be90e87

Browse files
committed
samd: Re-arrange the makefiles for the Variants WLAN and WLAN_BLE.
Variant WLAN: Support for WiFi. For the Adafruit Metro M4 board, this is the default. At boards with small available flash, SSL is not supported. Variant WLAN_BLE: Support for WiFi and BLE. Signed-off-by: robert-hh <robert@hammelrath.com>
1 parent 4bdfab7 commit be90e87

File tree

7 files changed

+51
-74
lines changed

7 files changed

+51
-74
lines changed

ports/samd/boards/ADAFRUIT_FEATHER_M4_EXPRESS/board.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
],
1616
"mcu": "samd51",
1717
"variants": {
18-
"WLAN": "WiFi support using a ESP32 module with NINA firmware"
18+
"WLAN": "WiFi support using a ESP32 module with NINA firmware",
19+
"WLAN_BLE": "WiFi and BLE support using a ESP32 module with NINA firmware"
1920
},
2021
"product": "Feather M4 Express",
2122
"thumbnail": "",

ports/samd/boards/ADAFRUIT_ITSYBITSY_M4_EXPRESS/board.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
],
1414
"mcu": "samd51",
1515
"variants": {
16-
"WLAN": "WiFi support using a ESP32 module with NINA firmware"
16+
"WLAN": "WiFi support using a ESP32 module with NINA firmware",
17+
"WLAN_BLE": "WiFi and BLE support using a ESP32 module with NINA firmware"
1718
},
1819
"product": "ItsyBitsy M4 Express",
1920
"thumbnail": "",

ports/samd/boards/ADAFRUIT_METRO_M4_EXPRESS/board.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"metro_m4_express_airlift.jpg"
1616
],
1717
"mcu": "samd51",
18+
"variants": {
19+
"WLAN_BLE": "WiFi and BLE support using a ESP32 module with NINA firmware"
20+
},
1821
"product": "Metro M4 Express Airlift",
1922
"thumbnail": "",
2023
"url": "https://www.adafruit.com/product/4000",

ports/samd/boards/ADAFRUIT_METRO_M4_EXPRESS/mpconfigboard.mk

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ CMSIS_MCU = SAMD51J19A
33
LD_FILES = boards/samd51x19a.ld sections.ld
44
TEXT0 = 0x4000
55

6-
# MicroPython settings
7-
MICROPY_PY_NETWORK = 1
8-
MICROPY_PY_NETWORK_NINAW10 = 1
9-
MICROPY_PY_SSL = 1
10-
MICROPY_SSL_MBEDTLS = 1
11-
126
MICROPY_HW_CODESIZE = 496K
7+
8+
BOARD_VARIANT ?= WLAN

ports/samd/boards/SPARKFUN_SAMD51_THING_PLUS/board.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
],
1515
"mcu": "samd51",
1616
"variants": {
17-
"WLAN": "WiFi support using a ESP32 module with NINA firmware"
17+
"WLAN": "WiFi support using a ESP32 module with NINA firmware",
18+
"WLAN_BLE": "WiFi and BLE support using a ESP32 module with NINA firmware"
1819
},
1920
"product": "Sparkfun SAMD51 Thing Plus",
2021
"thumbnail": "",

ports/samd/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "py/gc.h"
3030
#include "py/mperrno.h"
3131
#include "py/stackctrl.h"
32-
// #include "extmod/modbluetooth.h"
3332
#include "extmod/modnetwork.h"
3433
#include "shared/readline/readline.h"
3534
#include "shared/runtime/gchelper.h"

ports/samd/mcu/samd51/mpconfigmcu.mk

Lines changed: 40 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -9,70 +9,46 @@ MICROPY_HW_CODESIZE ?= 368K
99
MICROPY_VFS_LFS2 ?= 1
1010
MICROPY_VFS_FAT ?= 1
1111

12-
ifeq ($(BOARD_VARIANT),WLAN)
13-
14-
MICROPY_PY_NETWORK ?= 1
15-
MICROPY_PY_NETWORK_NINAW10 ?= 1
16-
ifeq ($(MICROPY_HW_CODESIZE),496K)
17-
MICROPY_PY_SSL ?= 1
18-
MICROPY_SSL_MBEDTLS ?= 1
19-
MICROPY_PY_BLUETOOTH ?= 1
20-
MICROPY_BLUETOOTH_NIMBLE ?= 1
21-
endif
22-
ifeq ($(MICROPY_HW_CODESIZE),1008K)
23-
MICROPY_PY_SSL ?= 1
24-
MICROPY_SSL_MBEDTLS ?= 1
25-
MICROPY_PY_BLUETOOTH ?= 1
26-
MICROPY_BLUETOOTH_NIMBLE ?= 1
27-
endif
28-
29-
endif
30-
31-
ifeq ($(MICROPY_PY_NETWORK),1)
32-
FROZEN_MANIFEST ?= mcu/$(MCU_SERIES_LOWER)/manifest_net.py
33-
else
34-
FROZEN_MANIFEST ?= mcu/$(MCU_SERIES_LOWER)/manifest.py
35-
endif
36-
3712
SRC_S += shared/runtime/gchelper_thumb2.s
38-
39-
SRC_C += \
40-
fatfs_port.c \
41-
mbedtls/mbedtls_port.c
42-
43-
44-
ifeq ($(MICROPY_PY_NETWORK),1)
45-
CFLAGS += -DMICROPY_PY_NETWORK=1
46-
47-
SHARED_SRC_C += \
48-
shared/netutils/dhcpserver.c \
49-
shared/netutils/netutils.c \
50-
shared/netutils/trace.c
51-
endif
52-
53-
ifeq ($(MICROPY_PY_NETWORK_NINAW10),1)
54-
CFLAGS += -DMICROPY_PY_NETWORK_NINAW10=1
55-
INC += -I$(TOP)/drivers/ninaw10
56-
57-
DRIVERS_SRC_C += \
58-
drivers/ninaw10/nina_bt_hci.c \
59-
drivers/ninaw10/nina_wifi_drv.c \
60-
drivers/ninaw10/nina_wifi_bsp.c \
61-
drivers/ninaw10/machine_pin_nina.c
62-
6313
SRC_C += \
64-
nina_wifi_bsp.c
65-
66-
endif
67-
68-
ifeq ($(MICROPY_BLUETOOTH_NIMBLE), 1)
69-
SRC_C += \
70-
mpbthciport.c \
71-
mpnimbleport.c
72-
73-
INC += \
74-
-I$(TOP)/extmod/nimble \
75-
-I$(TOP)/lib/mynewt-nimble/nimble/host/include \
76-
-I$(TOP)/lib/mynewt-nimble/nimble/include \
77-
-I$(TOP)/lib/mynewt-nimble/porting/nimble/include
14+
fatfs_port.c
15+
16+
ifneq ($(BOARD_VARIANT),)
17+
MICROPY_PY_NETWORK ?= 1
18+
CFLAGS += -DMICROPY_PY_NETWORK=1
19+
MICROPY_PY_NETWORK_NINAW10 ?= 1
20+
CFLAGS += -DMICROPY_PY_NETWORK_NINAW10=1
21+
22+
INC += -I$(TOP)/drivers/ninaw10
23+
SRC_C += \
24+
mbedtls/mbedtls_port.c\
25+
nina_wifi_bsp.c
26+
SHARED_SRC_C += \
27+
shared/netutils/dhcpserver.c \
28+
shared/netutils/netutils.c \
29+
shared/netutils/trace.c
30+
DRIVERS_SRC_C += \
31+
drivers/ninaw10/nina_bt_hci.c \
32+
drivers/ninaw10/nina_wifi_drv.c \
33+
drivers/ninaw10/nina_wifi_bsp.c \
34+
drivers/ninaw10/machine_pin_nina.c
35+
36+
ifeq ($(MICROPY_HW_CODESIZE),$(filter $(MICROPY_HW_CODESIZE), 496K 1008K))
37+
MICROPY_PY_SSL ?= 1
38+
MICROPY_SSL_MBEDTLS ?= 1
39+
40+
ifeq ($(BOARD_VARIANT),WLAN_BLE)
41+
MICROPY_PY_BLUETOOTH ?= 1
42+
MICROPY_BLUETOOTH_NIMBLE ?= 1
43+
SRC_C += \
44+
mpbthciport.c \
45+
mpnimbleport.c
46+
47+
INC += \
48+
-I$(TOP)/extmod/nimble
49+
endif
50+
endif
51+
FROZEN_MANIFEST ?= mcu/$(MCU_SERIES_LOWER)/manifest_net.py
52+
else
53+
FROZEN_MANIFEST ?= mcu/$(MCU_SERIES_LOWER)/manifest.py
7854
endif

0 commit comments

Comments
 (0)