Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
83f9fb16
Commit
83f9fb16
authored
Nov 05, 2019
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/natmod: Add uheapq example.
parent
37817ab4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
examples/natmod/uheapq/Makefile
examples/natmod/uheapq/Makefile
+13
-0
examples/natmod/uheapq/uheapq.c
examples/natmod/uheapq/uheapq.c
+17
-0
No files found.
examples/natmod/uheapq/Makefile
0 → 100644
View file @
83f9fb16
# Location of top-level MicroPython directory
MPY_DIR
=
../../..
# Name of module (different to built-in uheapq so it can coexist)
MOD
=
uheapq_
$(ARCH)
# Source files (.c or .py)
SRC
=
uheapq.c
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin)
ARCH
=
x64
include
$(MPY_DIR)/py/dynruntime.mk
examples/natmod/uheapq/uheapq.c
0 → 100644
View file @
83f9fb16
#define MICROPY_ENABLE_DYNRUNTIME (1)
#define MICROPY_PY_UHEAPQ (1)
#include "py/dynruntime.h"
#include "extmod/moduheapq.c"
mp_obj_t
mpy_init
(
mp_obj_fun_bc_t
*
self
,
size_t
n_args
,
size_t
n_kw
,
mp_obj_t
*
args
)
{
MP_DYNRUNTIME_INIT_ENTRY
mp_store_global
(
MP_QSTR___name__
,
MP_OBJ_NEW_QSTR
(
MP_QSTR_uheapq
));
mp_store_global
(
MP_QSTR_heappush
,
MP_OBJ_FROM_PTR
(
&
mod_uheapq_heappush_obj
));
mp_store_global
(
MP_QSTR_heappop
,
MP_OBJ_FROM_PTR
(
&
mod_uheapq_heappop_obj
));
mp_store_global
(
MP_QSTR_heapify
,
MP_OBJ_FROM_PTR
(
&
mod_uheapq_heapify_obj
));
MP_DYNRUNTIME_INIT_EXIT
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment