nrf5: Facilitate option to configure away the modble if needed. Enabled if MICROPY_PY_BLE config is enabled in bluetooth_conf.h.

This commit is contained in:
Glenn Ruben Bakke 2017-05-18 00:41:16 +02:00 committed by glennrub
parent 147d03feff
commit d1a4b19dc5

View File

@ -202,14 +202,21 @@ extern const struct _mp_obj_module_t music_module;
#if BLUETOOTH_SD
#if MICROPY_PY_BLE
extern const struct _mp_obj_module_t ble_module;
#define BLE_MODULE { MP_ROM_QSTR(MP_QSTR_ble), MP_ROM_PTR(&ble_module) },
#else
#define BLE_MODULE
#endif
#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_ROM_QSTR(MP_QSTR_pyb), MP_ROM_PTR(&pyb_module) }, \
{ MP_ROM_QSTR(MP_QSTR_machine), MP_ROM_PTR(&machine_module) }, \
{ MP_ROM_QSTR(MP_QSTR_ble), MP_ROM_PTR(&ble_module) }, \
{ MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, \
{ MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&mp_module_utime) }, \
{ MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_uos) }, \
BLE_MODULE \
MUSIC_MODULE \
UBLUEPY_MODULE \
@ -238,8 +245,8 @@ extern const struct _mp_obj_module_t ble_module;
// extra constants
#define MICROPY_PORT_CONSTANTS \
{ MP_ROM_QSTR(MP_QSTR_pyb), MP_ROM_PTR(&pyb_module) }, \
{ MP_ROM_QSTR(MP_QSTR_ble), MP_ROM_PTR(&ble_module) }, \
{ MP_ROM_QSTR(MP_QSTR_machine), MP_ROM_PTR(&machine_module) }, \
BLE_MODULE \
#define MP_STATE_PORT MP_STATE_VM