diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/builtin.h | 1 | ||||
-rw-r--r-- | py/builtintables.c | 3 | ||||
-rw-r--r-- | py/mpconfig.h | 4 | ||||
-rw-r--r-- | py/py.mk | 1 | ||||
-rw-r--r-- | py/qstrdefs.h | 7 |
5 files changed, 16 insertions, 0 deletions
diff --git a/py/builtin.h b/py/builtin.h index a69712bec7..58b821bf3c 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -91,3 +91,4 @@ 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_ure; +extern const mp_obj_module_t mp_module_uheapq; diff --git a/py/builtintables.c b/py/builtintables.c index 0e5daf6d8d..238d78872b 100644 --- a/py/builtintables.c +++ b/py/builtintables.c @@ -211,6 +211,9 @@ STATIC const mp_map_elem_t mp_builtin_module_table[] = { #if MICROPY_PY_URE { MP_OBJ_NEW_QSTR(MP_QSTR_ure), (mp_obj_t)&mp_module_ure }, #endif +#if MICROPY_PY_UHEAPQ + { MP_OBJ_NEW_QSTR(MP_QSTR_uheapq), (mp_obj_t)&mp_module_uheapq }, +#endif // extra builtin modules as defined by a port MICROPY_PORT_BUILTIN_MODULES diff --git a/py/mpconfig.h b/py/mpconfig.h index 4efe21d4b5..201621ea19 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -403,6 +403,10 @@ typedef double mp_float_t; #define MICROPY_PY_URE (0) #endif +#ifndef MICROPY_PY_UHEAPQ +#define MICROPY_PY_UHEAPQ (0) +#endif + /*****************************************************************************/ /* Hooks for a port to add builtins */ @@ -114,6 +114,7 @@ PY_O_BASENAME = \ ../extmod/modujson.o \ ../extmod/modure.o \ ../extmod/moduzlib.o \ + ../extmod/moduheapq.o \ # prepend the build destination prefix to the py object files PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME)) diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 0f520719f1..d1bb4dc246 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -485,3 +485,10 @@ Q(search) Q(group) Q(DEBUG) #endif + +#if MICROPY_PY_UHEAPQ +Q(uheapq) +Q(heappush) +Q(heappop) +Q(heapify) +#endif |