Skip to content

Commit 60480ff

Browse files
authored
Merge pull request #1351 from jepler/issue1307-ujson
json: enable on nrf boards and "large flash" M4 samd boards
2 parents 4e8531f + 52fd151 commit 60480ff

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ports/atmel-samd/mpconfigport.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ extern const struct _mp_obj_module_t wiznet_module;
286286
#define WIZNET_MODULE
287287
#endif
288288

289+
// (u)json depends, perhaps erroneously, on MICROPY_PY_IO
290+
#if MICROPY_PY_IO
291+
#define JSON_MODULE { MP_ROM_QSTR(MP_QSTR_json), MP_ROM_PTR(&mp_module_ujson) },
292+
#define MICROPY_PY_UJSON (1)
293+
#else
294+
#define JSON_MODULE
295+
#endif
296+
289297

290298
#ifndef EXTRA_BUILTIN_MODULES
291299
#define EXTRA_BUILTIN_MODULES \
@@ -297,6 +305,7 @@ extern const struct _mp_obj_module_t wiznet_module;
297305
NETWORK_MODULE \
298306
SOCKET_MODULE \
299307
WIZNET_MODULE \
308+
JSON_MODULE \
300309
{ MP_OBJ_NEW_QSTR(MP_QSTR_rotaryio), (mp_obj_t)&rotaryio_module }, \
301310
{ MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module }
302311
#endif

ports/nrf/mpconfigport.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (0)
113113
#define MICROPY_PY_UCTYPES (0)
114114
#define MICROPY_PY_UZLIB (0)
115-
#define MICROPY_PY_UJSON (0)
115+
#define MICROPY_PY_UJSON (1)
116116
#define MICROPY_PY_URE (0)
117117
#define MICROPY_PY_UHEAPQ (0)
118118
#define MICROPY_PY_UHASHLIB (1)
@@ -204,6 +204,7 @@ extern const struct _mp_obj_module_t bleio_module;
204204
{ MP_OBJ_NEW_QSTR (MP_QSTR_supervisor ), (mp_obj_t)&supervisor_module }, \
205205
{ MP_OBJ_NEW_QSTR (MP_QSTR_gamepad ), (mp_obj_t)&gamepad_module }, \
206206
{ MP_OBJ_NEW_QSTR (MP_QSTR_time ), (mp_obj_t)&time_module }, \
207+
{ MP_OBJ_NEW_QSTR (MP_QSTR_json ), (mp_obj_t)&mp_module_ujson }, \
207208
USBHID_MODULE \
208209
BLEIO_MODULE
209210

0 commit comments

Comments
 (0)