This repository was archived by the owner on Apr 25, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ SRC_C = \
5454 moducomponents.c \
5555 moducomputer.c \
5656 moduos.c \
57+ moduimp.c \
5758 modutime.c \
5859 modumsgpack.c \
5960 moduvalue.c \
Original file line number Diff line number Diff line change 11#include <string.h>
2+ #include <stdarg.h>
23
34#include "py/obj.h"
45#include "py/compile.h"
1314#include "gccollect.h"
1415#include "machine.h"
1516#include "syscall.h"
16- #include <stdarg.h>
1717
1818void debug_printer (void * self , const char * buf , size_t len ) {
1919 __syscall2 (SYS_DEBUG , (int ) buf , (int ) len );
Original file line number Diff line number Diff line change 1- #include <stdio.h>
2-
31#include "py/obj.h"
4- #include "py/objstr.h"
52#include "py/runtime.h"
63#include "py/mphal.h"
7- #include "syscall.h"
8- #include "machine.h"
94#include "extmod/machine_mem.h"
10- #include "lib/mpack/mpack.h"
11-
12- #include <stdio.h>
13- #include <string.h>
5+ #include "syscall.h"
146
157mp_obj_t signal_hook_obj = mp_const_none ;
168mp_obj_t stdout_hook_obj = mp_const_none ;
Original file line number Diff line number Diff line change 1- #include <stdio.h>
2-
1+ #include "py/obj.h"
2+ #include "py/mphal.h"
3+ #include "py/runtime.h"
34#include "py/lexer.h"
45#include "py/compile.h"
56#include "py/parse.h"
67#include "py/repl.h"
78#include "lib/utils/pyexec.h"
89#include "lib/mp-readline/readline.h"
910
10- #include "py/obj.h"
11- #include "py/objstr.h"
12- #include "py/runtime.h"
13- #include "openpie_vfs.h"
14- #include "syscall.h"
15- #include "msgpack.h"
16- #include "py/mphal.h"
17- #include "machine.h"
18- #include "extmod/machine_mem.h"
19- #include "lib/mpack/mpack.h"
20-
21- #include <stdio.h>
22- #include <string.h>
23-
2411
2512#define EXEC_FLAG_PRINT_EOF (1)
2613#define EXEC_FLAG_ALLOW_DEBUGGING (2)
Original file line number Diff line number Diff line change 1- #include <stdio.h>
2-
31#include "py/obj.h"
4- #include "py/objstr.h"
5- #include "py/runtime.h"
6- #include "py/mphal.h"
7- #include "syscall.h"
82#include "msgpack.h"
9- #include "machine.h"
10- #include "lib/mpack/mpack.h"
11-
12- #include <stdio.h>
13- #include <string.h>
14-
3+ #include "syscall.h"
154
165mp_obj_t wrap_result (int code );
176
Original file line number Diff line number Diff line change 1- #include <stdio.h>
2-
31#include "py/obj.h"
4- #include "py/objstr.h"
5- #include "py/runtime.h"
6- #include "py/mphal.h"
7- #include "syscall.h"
8- #include "msgpack.h"
92#include "machine.h"
10- #include "lib/mpack/mpack.h"
11-
12- #include <stdio.h>
13- #include <string.h>
14-
3+ #include "msgpack.h"
4+ #include "syscall.h"
155
166mp_obj_t wrap_result (int code );
177
18- mp_obj_t ucomputer_debug (mp_obj_t );
198
209
21- mp_obj_t ucomputer_shutdown () {
10+ STATIC mp_obj_t ucomputer_shutdown () {
2211 __syscall0 (SYS_CONTROL_SHUTDOWN );
2312 __fatal_error ("shutdown failure" );
2413}
2514
2615MP_DEFINE_CONST_FUN_OBJ_0 (ucomputer_shutdown_obj , ucomputer_shutdown );
2716
2817
29- mp_obj_t ucomputer_reboot () {
18+ STATIC mp_obj_t ucomputer_reboot () {
3019 __syscall0 (SYS_CONTROL_REBOOT );
3120 __fatal_error ("reboot failure" );
3221}
3322
3423MP_DEFINE_CONST_FUN_OBJ_0 (ucomputer_reboot_obj , ucomputer_reboot );
3524
3625
37- mp_obj_t ucomputer_crash (mp_obj_t message_obj ) {
26+ STATIC mp_obj_t ucomputer_crash (mp_obj_t message_obj ) {
3827 size_t len = 0 ;
3928 const char * message = mp_obj_str_get_data (message_obj , & len );
4029 __syscall2 (SYS_CONTROL_CRASH , (int ) message , (int ) len );
Original file line number Diff line number Diff line change 1+ #include "py/obj.h"
2+
3+
4+ STATIC mp_obj_t uimp_new_module (mp_obj_t name_obj ) {
5+ return mp_obj_new_module (name_obj );
6+ }
7+
8+ MP_DEFINE_CONST_FUN_OBJ_1 (uimp_new_module_obj , uimp_new_module );
9+
10+
11+ STATIC const mp_rom_map_elem_t uimp_module_globals_table [] = {
12+ {MP_ROM_QSTR (MP_QSTR___name__ ), MP_ROM_QSTR (MP_QSTR_uimp )},
13+
14+ {MP_ROM_QSTR (MP_QSTR_new_module ), MP_ROM_PTR (& uimp_new_module_obj )},
15+ };
16+ STATIC MP_DEFINE_CONST_DICT (uimp_module_globals , uimp_module_globals_table );
17+
18+ const mp_obj_module_t mp_module_uimp = {
19+ .base = {& mp_type_module },
20+ .globals = (mp_obj_dict_t * ) & ucode_module_globals ,
21+ };
Original file line number Diff line number Diff line change 1- #include <stdio.h>
2- #include <string.h>
3-
41#include "py/obj.h"
5- #include "py/objstr.h"
62#include "py/runtime.h"
73#include "msgpack.h"
8- #include "lib/mpack/mpack.h"
94
105mp_obj_t umsgpack_dumps (mp_obj_t obj ) {
116 msgpack_result_t result = msgpack_dumps (obj );
Original file line number Diff line number Diff line change 1- #include <stdio.h>
2- #include <string.h>
3-
4- #include "py/nlr.h"
5- #include "py/smallint.h"
61#include "py/obj.h"
7- #include "lib/timeutils/timeutils.h"
82#include "extmod/utime_mphal.h"
3+ #include "lib/timeutils/timeutils.h"
94#include "syscall.h"
105
116mp_obj_t wrap_result (int code );
Original file line number Diff line number Diff line change 1- #include <stdio.h>
2-
31#include "py/obj.h"
4- #include "py/objstr.h"
52#include "py/runtime.h"
6- #include "py/mphal.h"
73#include "syscall.h"
84#include "msgpack.h"
95#include "machine.h"
10- #include "lib/mpack/mpack.h"
116#include "uvalue.h"
127
13- #include <stdio.h>
14- #include <string.h>
15-
168mp_obj_t wrap_result (int code );
179
1810
You can’t perform that action at this time.
0 commit comments