Skip to content
This repository was archived by the owner on Apr 25, 2021. It is now read-only.

Commit 839c228

Browse files
committed
oprom 업데이트
1 parent f65da64 commit 839c228

14 files changed

Lines changed: 43 additions & 78 deletions

src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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 \

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <string.h>
2+
#include <stdarg.h>
23

34
#include "py/obj.h"
45
#include "py/compile.h"
@@ -13,7 +14,6 @@
1314
#include "gccollect.h"
1415
#include "machine.h"
1516
#include "syscall.h"
16-
#include <stdarg.h>
1717

1818
void debug_printer(void *self, const char *buf, size_t len) {
1919
__syscall2(SYS_DEBUG, (int) buf, (int) len);

src/modmachine.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
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

157
mp_obj_t signal_hook_obj = mp_const_none;
168
mp_obj_t stdout_hook_obj = mp_const_none;

src/moducode.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
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)

src/moducomponents.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
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

165
mp_obj_t wrap_result(int code);
176

src/moducomputer.c

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,29 @@
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

166
mp_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

2615
MP_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

3423
MP_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);

src/moduimp.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
};

src/modumsgpack.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
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

105
mp_obj_t umsgpack_dumps(mp_obj_t obj) {
116
msgpack_result_t result = msgpack_dumps(obj);

src/modutime.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
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

116
mp_obj_t wrap_result(int code);

src/moduvalue.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
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-
168
mp_obj_t wrap_result(int code);
179

1810

0 commit comments

Comments
 (0)