summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorLucian Copeland <hierophect@gmail.com>2020-11-10 14:59:32 -0500
committerLucian Copeland <hierophect@gmail.com>2020-11-10 14:59:32 -0500
commit21ca1b8c2bcf5be54117e2de0381eb956e60d0df (patch)
tree6dd265af0965265912972c8c2eadfed44ced4d11 /py
parentd16d27a4491c3e0e5ad4c0a10344e9865b8a1fe2 (diff)
parent75a977febd27fc69f2c2dc3c017e765d215be633 (diff)
Merge remote-tracking branch 'upstream/main' into esp32s2-udp
Diffstat (limited to 'py')
-rw-r--r--py/circuitpy_mpconfig.h10
-rw-r--r--py/objmodule.c7
2 files changed, 16 insertions, 1 deletions
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h
index 1e01bd9c5..08efabddb 100644
--- a/py/circuitpy_mpconfig.h
+++ b/py/circuitpy_mpconfig.h
@@ -197,6 +197,9 @@ typedef long mp_off_t;
#ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD)
#endif
+#ifndef MICROPY_PY_UBINASCII
+#define MICROPY_PY_UBINASCII (CIRCUITPY_FULL_BUILD)
+#endif
// Opposite setting is deliberate.
#define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD)
#ifndef MICROPY_PY_URE
@@ -699,6 +702,12 @@ extern const struct _mp_obj_module_t ustack_module;
#endif
// These modules are not yet in shared-bindings, but we prefer the non-uxxx names.
+#if MICROPY_PY_UBINASCII
+#define BINASCII_MODULE { MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) },
+#else
+#define BINASCII_MODULE
+#endif
+
#if MICROPY_PY_UERRNO
#define ERRNO_MODULE { MP_ROM_QSTR(MP_QSTR_errno), MP_ROM_PTR(&mp_module_uerrno) },
#else
@@ -770,6 +779,7 @@ extern const struct _mp_obj_module_t wifi_module;
AUDIOMIXER_MODULE \
AUDIOMP3_MODULE \
AUDIOPWMIO_MODULE \
+ BINASCII_MODULE \
BITBANGIO_MODULE \
BLEIO_MODULE \
BOARD_MODULE \
diff --git a/py/objmodule.c b/py/objmodule.c
index 757aece04..90796c535 100644
--- a/py/objmodule.c
+++ b/py/objmodule.c
@@ -239,7 +239,12 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
{ MP_ROM_QSTR(MP_QSTR_hashlib), MP_ROM_PTR(&mp_module_uhashlib) },
#endif
#if MICROPY_PY_UBINASCII
- { MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) },
+#if CIRCUITPY
+// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
+// TODO: move to shared-bindings/
+#else
+ { MP_ROM_QSTR(MP_QSTR_ubinascii), MP_ROM_PTR(&mp_module_ubinascii) },
+#endif
#endif
#if MICROPY_PY_URANDOM
{ MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&mp_module_urandom) },