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;