From 5da0486c67be7a6d0cd3106ad9dfb495fb70eed2 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Wed, 1 Jul 2026 16:49:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=B8=BB=E7=BA=BF=E5=BE=85=E5=90=88?= =?UTF-8?q?=E3=80=91=E6=94=AF=E6=8C=81=E4=BA=86common=5Fcfg=E5=90=8E?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87=E8=AF=A5=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0mcu=E4=B8=8E=E5=85=B6=E4=BB=96=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0lua=E7=9A=84=E5=B7=AE=E5=BC=82=EF=BC=9B=E6=97=A0?= =?UTF-8?q?=E9=9C=80=E5=86=8D=E4=BD=BF=E7=94=A8=E5=BC=BA=E7=AC=A6=E5=8F=B7?= =?UTF-8?q?=E9=94=9A=E7=82=B9=EF=BC=8C=E6=AD=A4=E5=A4=96=E8=AF=B7=E5=85=B3?= =?UTF-8?q?=E6=B3=A8=E4=B8=80=E4=B8=8Belog=E6=98=AF=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E4=B9=9F=E5=8F=AF=E4=BB=A5=E8=BF=99=E4=B9=88=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bspMCU/l_stm32.c | 6 ------ library/common/include/common.h | 10 ---------- lua/lua.c | 11 +++-------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/bspMCU/l_stm32.c b/bspMCU/l_stm32.c index 92a370e..07a972d 100644 --- a/bspMCU/l_stm32.c +++ b/bspMCU/l_stm32.c @@ -1,10 +1,4 @@ #include "common.h" - -void Rd_lstm32EnableStrong(void) -{ - // 用于强符号覆盖的锚点 -} - #ifdef USE_LUA_ST #include #include "lua_base.h" diff --git a/library/common/include/common.h b/library/common/include/common.h index dd7843b..607554b 100644 --- a/library/common/include/common.h +++ b/library/common/include/common.h @@ -164,9 +164,6 @@ extern void Rd_ThreadEnableStrong(void); #ifdef BUILD_PLATFORM_WIN32 extern void Rd_Win32EnableStrong(void); #endif -#ifdef BUILD_BSPMCU -extern void Rd_lstm32EnableStrong(void); -#endif #ifdef BUILD_LOG #define INIT_LOG_PART() do { Rd_ElogEnableStrong(); } while(0) @@ -186,12 +183,6 @@ extern void Rd_lstm32EnableStrong(void); #define INIT_WIN32_PART() do {} while(0) #endif -#ifdef BUILD_BSPMCU - #define INIT_BSPMCU_PART() do { Rd_lstm32EnableStrong(); } while(0) -#else - #define INIT_BSPMCU_PART() do {} while(0) -#endif - #define RD_INIT() \ do { \ INIT_LOG_PART(); \ @@ -199,7 +190,6 @@ extern void Rd_lstm32EnableStrong(void); Rd_MemPoolInit_Auto(); \ INIT_LINUX_PART(); \ INIT_WIN32_PART(); \ - INIT_BSPMCU_PART(); \ } while(0) #endif /* end of include guard: COMMON_H */ diff --git a/lua/lua.c b/lua/lua.c index e1892d9..dc5c0a9 100644 --- a/lua/lua.c +++ b/lua/lua.c @@ -395,12 +395,7 @@ static char *readline(const char *_pcPrompt, char *_pcBuffer, int _iSize, int _i return NULL; } -WEAK int luaopen_stm32(lua_State *L) -{ - lua_newtable(L); - lua_setglobal(L, "st"); - return 1; -} +extern int luaopen_stm32(lua_State *L); int lua_init(lua_output _lua_print) { @@ -445,9 +440,9 @@ int lua_init(lua_output _lua_print) return RD_FAILURE; } luaL_openlibs(L); - +#ifdef USE_LUA_ST luaopen_stm32(L); - +#endif lua_print("Lua REPL V5.4\nType 'exit' or Ctrl+D to quit.\n\n"); lua_print("%s", incomplete ? CONT_PROMPT : PROMPT); return 0;