diff options
| author | Glenn Ruben Bakke <glennbakke@gmail.com> | 2020-07-23 12:12:24 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-08-08 23:09:26 +1000 |
| commit | 85cad502660e8d1359f175402aaea98695b3521f (patch) | |
| tree | b23946d898bf0195a54dd72a333d2bdaf7187ed2 | |
| parent | 5a873e27eb5d03f6d5cfedab2dbf3532ac8ac849 (diff) | |
nrf/mpconfigport.h: Expose nrf module when MICROPY_PY_NRF is set.
| -rw-r--r-- | ports/nrf/mpconfigport.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 183fdf681..d1e9665de 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -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) @@ -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 @@ -255,6 +266,7 @@ extern const struct _mp_obj_module_t ble_module; MUSIC_MODULE \ UBLUEPY_MODULE \ MICROPY_BOARD_BUILTINS \ + NRF_MODULE \ #else @@ -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 |
