summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2019-09-30 12:23:00 +1000
committerJim Mussared <jim.mussared@gmail.com>2019-10-01 09:51:02 +1000
commit6f35f214d36ac9a58a069d163e3ab9ba05d650dd (patch)
treefcabd1ad4b1a8f2401736e733a04c8964373e0bb
parenteb1b6858a2c5454f84ab4bb0b854b96d234995c8 (diff)
stm32/mpconfigport.h: Add modbluetooth module to stm32.
-rw-r--r--ports/stm32/Makefile6
-rw-r--r--ports/stm32/mpconfigport.h8
2 files changed, 14 insertions, 0 deletions
diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile
index 0e3b4f8e3..40db2f756 100644
--- a/ports/stm32/Makefile
+++ b/ports/stm32/Makefile
@@ -379,6 +379,12 @@ SRC_USBDEV = $(addprefix $(USBDEV_DIR)/,\
class/src/usbd_msc_scsi.c \
)
+ifeq ($(MICROPY_PY_BLUETOOTH),1)
+CFLAGS_MOD += -DMICROPY_PY_BLUETOOTH=1
+CFLAGS_MOD += -DMICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE=1
+CFLAGS_MOD += -DMICROPY_PY_BLUETOOTH_GATTS_ON_READ_CALLBACK=1
+endif
+
ifeq ($(MICROPY_PY_NETWORK_CYW43),1)
CFLAGS_MOD += -DMICROPY_PY_NETWORK_CYW43=1
SRC_C += sdio.c
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h
index b9c6cdedd..54e1c503c 100644
--- a/ports/stm32/mpconfigport.h
+++ b/ports/stm32/mpconfigport.h
@@ -211,6 +211,7 @@ extern const struct _mp_obj_module_t mp_module_uos;
extern const struct _mp_obj_module_t mp_module_utime;
extern const struct _mp_obj_module_t mp_module_usocket;
extern const struct _mp_obj_module_t mp_module_network;
+extern const struct _mp_obj_module_t mp_module_bluetooth;
extern const struct _mp_obj_module_t mp_module_onewire;
#if MICROPY_PY_STM
@@ -245,6 +246,12 @@ extern const struct _mp_obj_module_t mp_module_onewire;
#define NETWORK_BUILTIN_MODULE
#endif
+#if MICROPY_PY_BLUETOOTH
+#define BLUETOOTH_BUILTIN_MODULE { MP_ROM_QSTR(MP_QSTR_bluetooth), MP_ROM_PTR(&mp_module_bluetooth) },
+#else
+#define BLUETOOTH_BUILTIN_MODULE
+#endif
+
#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&machine_module) }, \
{ MP_ROM_QSTR(MP_QSTR_pyb), MP_ROM_PTR(&pyb_module) }, \
@@ -253,6 +260,7 @@ extern const struct _mp_obj_module_t mp_module_onewire;
{ MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, \
SOCKET_BUILTIN_MODULE \
NETWORK_BUILTIN_MODULE \
+ BLUETOOTH_BUILTIN_MODULE \
{ MP_ROM_QSTR(MP_QSTR__onewire), MP_ROM_PTR(&mp_module_onewire) }, \
#define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \