diff --git a/components/base_nodemcu/user_main.c b/components/base_nodemcu/user_main.c index 0a70e58b..c5f4df20 100644 --- a/components/base_nodemcu/user_main.c +++ b/components/base_nodemcu/user_main.c @@ -120,7 +120,7 @@ static void start_lua () { NODE_DBG("Task task_lua started.\n"); if (lua_main()) // If it returns true then LFS restart is needed - lua_main(); + esp_restart(); } static void nodemcu_init(void) diff --git a/components/lua/lua-5.3/lnodemcu.c b/components/lua/lua-5.3/lnodemcu.c index 7eb70fcd..b7f4a40c 100644 --- a/components/lua/lua-5.3/lnodemcu.c +++ b/components/lua/lua-5.3/lnodemcu.c @@ -629,10 +629,9 @@ LUAI_FUNC int luaN_init (lua_State *L) { lua_getglobal(L, #t); luaL_getmetafield( L, 1, #f ); lua_remove(L, -2); LUALIB_API void luaL_lfsreload (lua_State *L) { -#if defined(CONFIG_NODEMCU_EMBEDDED_FLS_SIZE) - (void)L; +#if defined(CONFIG_NODEMCU_EMBEDDED_LFS_SIZE) lua_pushstring(L, "Not allowed to write to LFS section"); - return 1; + return; #else #ifdef LUA_USE_ESP size_t l;