Skip to content

Commit

Permalink
nrf/mpconfigport.h: Expose nrf module when MICROPY_PY_NRF is set.
Browse files Browse the repository at this point in the history
  • Loading branch information
glennrub authored and dpgeorge committed Aug 8, 2021
1 parent 5a873e2 commit 85cad50
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ports/nrf/mpconfigport.h
Expand Up @@ -179,6 +179,10 @@
#define MICROPY_PY_TIME_TICKS (1)
#endif

#ifndef MICROPY_PY_NRF
#define MICROPY_PY_NRF (0)
#endif

#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0)

Expand Down Expand Up @@ -212,11 +216,18 @@ typedef long mp_off_t;
// extra built in modules to add to the list of known ones
extern const struct _mp_obj_module_t board_module;
extern const struct _mp_obj_module_t machine_module;
extern const struct _mp_obj_module_t nrf_module;
extern const struct _mp_obj_module_t mp_module_utime;
extern const struct _mp_obj_module_t mp_module_uos;
extern const struct _mp_obj_module_t mp_module_ubluepy;
extern const struct _mp_obj_module_t music_module;

#if MICROPY_PY_NRF
#define NRF_MODULE { MP_ROM_QSTR(MP_QSTR_nrf), MP_ROM_PTR(&nrf_module) },
#else
#define NRF_MODULE
#endif

#if MICROPY_PY_UBLUEPY
#define UBLUEPY_MODULE { MP_ROM_QSTR(MP_QSTR_ubluepy), MP_ROM_PTR(&mp_module_ubluepy) },
#else
Expand Down Expand Up @@ -255,6 +266,7 @@ extern const struct _mp_obj_module_t ble_module;
MUSIC_MODULE \
UBLUEPY_MODULE \
MICROPY_BOARD_BUILTINS \
NRF_MODULE \


#else
Expand All @@ -266,6 +278,7 @@ extern const struct _mp_obj_module_t ble_module;
{ MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_uos) }, \
MUSIC_MODULE \
MICROPY_BOARD_BUILTINS \
NRF_MODULE \


#endif // BLUETOOTH_SD
Expand Down

0 comments on commit 85cad50

Please sign in to comment.