summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2022-03-03 17:59:30 +1100
committerDamien George <damien@micropython.org>2022-03-09 10:03:23 +1100
commit926b554dafffa1e9bd80aa12fea5c621221c9d79 (patch)
tree448ffc696c24da0ef1e88c6c46f2f8bd328ab0a2 /py
parent507ad03329983551635831c0b5ba76319eaca165 (diff)
extmod/moduos: Create general uos module to be used by all ports.
Based on the rp2 port version, with the rp2 port converted to use this module. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py')
-rw-r--r--py/builtin.h1
-rw-r--r--py/mpconfig.h4
-rw-r--r--py/objmodule.c3
3 files changed, 8 insertions, 0 deletions
diff --git a/py/builtin.h b/py/builtin.h
index 8639e978f..162fed77c 100644
--- a/py/builtin.h
+++ b/py/builtin.h
@@ -108,6 +108,7 @@ extern const mp_obj_module_t mp_module_uerrno;
extern const mp_obj_module_t mp_module_uctypes;
extern const mp_obj_module_t mp_module_uzlib;
extern const mp_obj_module_t mp_module_ujson;
+extern const mp_obj_module_t mp_module_uos;
extern const mp_obj_module_t mp_module_ure;
extern const mp_obj_module_t mp_module_uheapq;
extern const mp_obj_module_t mp_module_uhashlib;
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 5edff69df..8f9f0f02f 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1455,6 +1455,10 @@ typedef double mp_float_t;
#define MICROPY_PY_UJSON_SEPARATORS (1)
#endif
+#ifndef MICROPY_PY_UOS
+#define MICROPY_PY_UOS (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
+#endif
+
#ifndef MICROPY_PY_URE
#define MICROPY_PY_URE (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
#endif
diff --git a/py/objmodule.c b/py/objmodule.c
index 4b04f7ca9..f7cd437ba 100644
--- a/py/objmodule.c
+++ b/py/objmodule.c
@@ -190,6 +190,9 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
#if MICROPY_PY_UJSON
{ MP_ROM_QSTR(MP_QSTR_ujson), MP_ROM_PTR(&mp_module_ujson) },
#endif
+ #if MICROPY_PY_UOS
+ { MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_uos) },
+ #endif
#if MICROPY_PY_URE
{ MP_ROM_QSTR(MP_QSTR_ure), MP_ROM_PTR(&mp_module_ure) },
#endif