nrf5: Adding ubluepy module to builtins if bluetooth stack is selected. Disable NUS profile by default. Adding source for ubluepy module into makefile to be included in build. The source is only linked if MICROPY_PY_UBLUEPY is set.

This commit is contained in:
Glenn Ruben Bakke 2017-02-08 00:05:37 +01:00
parent 0f609cd799
commit 35a7aa1331
3 changed files with 16 additions and 2 deletions

View File

@ -165,6 +165,11 @@ DRIVERS_SRC_C += $(addprefix modules/,\
uos/moduos.c \
utime/modutime.c \
pyb/modpyb.c \
ubluepy/modubluepy.c \
ubluepy/ubluepy_peripheral.c \
ubluepy/ubluepy_service.c \
ubluepy/ubluepy_characteristic.c \
ubluepy/ubluepy_uuid.c \
)
#ifeq ($(SD), )

View File

@ -235,6 +235,7 @@ extern const struct _mp_obj_module_t mp_module_network;
extern const struct _mp_obj_module_t mp_module_lcd_mono_fb;
extern const struct _mp_obj_module_t mp_module_display;
extern const struct _mp_obj_module_t graphics_module;
extern const struct _mp_obj_module_t mp_module_ubluepy;
#if MICROPY_PY_USOCKET
#define SOCKET_BUILTIN_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usocket), (mp_obj_t)&mp_module_usocket },
@ -263,11 +264,17 @@ extern const struct _mp_obj_module_t graphics_module;
#endif
#if MICROPY_PY_DISPLAY_GRAPHICS
#define GRAPHICS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_draw), (mp_obj_t)&graphics_module },
#define GRAPHICS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_draw), (mp_obj_t)&graphics_module },
#else
#define GRAPHICS_MODULE
#endif
#if MICROPY_PY_UBLUEPY
#define UBLUEPY_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ubluepy), (mp_obj_t)&mp_module_ubluepy },
#else
#define UBLUEPY_MODULE
#endif
#if BLUETOOTH_SD
extern const struct _mp_obj_module_t ble_module;
@ -283,6 +290,7 @@ extern const struct _mp_obj_module_t ble_module;
LCD_MONO_FB_MODULE \
DISPLAY_MODULE \
GRAPHICS_MODULE \
UBLUEPY_MODULE \
#else

View File

@ -17,7 +17,8 @@
#elif (BLUETOOTH_SD == 132)
#define MICROPY_PY_BLE (1)
#define MICROPY_PY_BLE_NUS (1)
#define MICROPY_PY_BLE_NUS (0)
#define MICROPY_PY_UBLUEPY (1)
#else
#error "SD not supported"