Skip to content

Commit 9a8630e

Browse files
authored
Merge pull request #53 from SummerGGift/2018_8_30
【完善】:当使用 python 命令执行文件的时候,将提示先开启 UOS 模块
2 parents 11c9a0b + 321d2a0 commit 9a8630e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

port/mpy_main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ void mpy_main(const char *filename) {
8080
// Make MicroPython's stack limit somewhat smaller than full stack available
8181
mp_stack_set_limit(FINSH_THREAD_STACK_SIZE - 1024);
8282

83-
#if MICROPY_ENABLE_GC
83+
#if MICROPY_ENABLE_GC
8484
heap = rt_malloc(MICROPY_HEAP_SIZE);
8585
if (!heap) {
8686
rt_kprintf("No memory for MicroPython Heap!\n");
8787
return;
8888
}
8989
gc_init(heap, heap + MICROPY_HEAP_SIZE);
90-
#endif
90+
#endif
9191

9292
/* MicroPython initialization */
9393
mp_init();
@@ -100,7 +100,11 @@ void mpy_main(const char *filename) {
100100
readline_init0();
101101

102102
if (filename) {
103+
#ifndef MICROPYTHON_USING_UOS
104+
rt_kprintf("Please enable uos module in sys module option first.\n");
105+
#else
103106
pyexec_file(filename);
107+
#endif
104108
} else {
105109
#ifdef MICROPYTHON_USING_UOS
106110
// run boot-up scripts

0 commit comments

Comments
 (0)