summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2018-11-27 11:29:29 -0800
committerGitHub <noreply@github.com>2018-11-27 11:29:29 -0800
commit60480ff4ed847d2979ea2b8abc812f3392761f05 (patch)
tree4e11786a5d514bc524a7a05dfc6f7ddf4c05344a
parent4e8531f4a2d9e1445a7a5d4b87ae7639628027e6 (diff)
parent52fd151c9c824ee9c51a401019e44c2e4695fbeb (diff)
Merge pull request #1351 from jepler/issue1307-ujson
json: enable on nrf boards and "large flash" M4 samd boards
-rw-r--r--ports/atmel-samd/mpconfigport.h9
-rw-r--r--ports/nrf/mpconfigport.h3
2 files changed, 11 insertions, 1 deletions
diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h
index 392b0773e..829a0faaf 100644
--- a/ports/atmel-samd/mpconfigport.h
+++ b/ports/atmel-samd/mpconfigport.h
@@ -286,6 +286,14 @@ extern const struct _mp_obj_module_t wiznet_module;
#define WIZNET_MODULE
#endif
+ // (u)json depends, perhaps erroneously, on MICROPY_PY_IO
+ #if MICROPY_PY_IO
+ #define JSON_MODULE { MP_ROM_QSTR(MP_QSTR_json), MP_ROM_PTR(&mp_module_ujson) },
+ #define MICROPY_PY_UJSON (1)
+ #else
+ #define JSON_MODULE
+ #endif
+
#ifndef EXTRA_BUILTIN_MODULES
#define EXTRA_BUILTIN_MODULES \
@@ -297,6 +305,7 @@ extern const struct _mp_obj_module_t wiznet_module;
NETWORK_MODULE \
SOCKET_MODULE \
WIZNET_MODULE \
+ JSON_MODULE \
{ MP_OBJ_NEW_QSTR(MP_QSTR_rotaryio), (mp_obj_t)&rotaryio_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module }
#endif
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index 7b2b8f1d1..86f5af20a 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -112,7 +112,7 @@
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (0)
#define MICROPY_PY_UCTYPES (0)
#define MICROPY_PY_UZLIB (0)
-#define MICROPY_PY_UJSON (0)
+#define MICROPY_PY_UJSON (1)
#define MICROPY_PY_URE (0)
#define MICROPY_PY_UHEAPQ (0)
#define MICROPY_PY_UHASHLIB (1)
@@ -204,6 +204,7 @@ extern const struct _mp_obj_module_t bleio_module;
{ MP_OBJ_NEW_QSTR (MP_QSTR_supervisor ), (mp_obj_t)&supervisor_module }, \
{ MP_OBJ_NEW_QSTR (MP_QSTR_gamepad ), (mp_obj_t)&gamepad_module }, \
{ MP_OBJ_NEW_QSTR (MP_QSTR_time ), (mp_obj_t)&time_module }, \
+ { MP_OBJ_NEW_QSTR (MP_QSTR_json ), (mp_obj_t)&mp_module_ujson }, \
USBHID_MODULE \
BLEIO_MODULE