Skip to content

Commit ce3dff7

Browse files
committed
【修改】开机自启动文件 main.py 路径
1 parent 23d67f8 commit ce3dff7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

port/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ typedef long mp_off_t;
330330
#define MICROPY_HW_MCU_NAME "RT-Thread"
331331
#define MICROPY_PY_PATH_FIRST "/libs/mpy/"
332332
#define MICROPY_PY_PATH_SECOND "/scripts/"
333+
#define MICROPY_MAIN_PY_PATH "/scripts/main.py"
333334

334335
#define MICROPY_BEGIN_ATOMIC_SECTION() rt_hw_interrupt_disable()
335336
#define MICROPY_END_ATOMIC_SECTION(state) rt_hw_interrupt_enable(state)

port/mpy_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void mpy_main(const char *filename) {
115115
#ifdef MICROPYTHON_USING_UOS
116116
// run boot-up scripts
117117
void *frozen_data;
118-
const char *_boot_file = "_boot.py", *boot_file = "boot.py", *main_file = "main.py";
118+
const char *_boot_file = "_boot.py", *boot_file = "boot.py", *main_file = MICROPY_MAIN_PY_PATH;
119119
if (mp_find_frozen_module(_boot_file, strlen(_boot_file), &frozen_data) != MP_FROZEN_NONE) {
120120
pyexec_frozen_module(_boot_file);
121121
}

0 commit comments

Comments
 (0)