Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
ed85e21a
Commit
ed85e21a
authored
Oct 17, 2022
by
Tom Sutcliffe
Committed by
Johny Mattsson
Nov 17, 2022
Browse files
Allow LUA_INIT_STRING to be set in menuconfig
parent
f592cf4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
components/lua/Kconfig
View file @
ed85e21a
...
@@ -132,4 +132,35 @@ menu "Lua configuration"
...
@@ -132,4 +132,35 @@ menu "Lua configuration"
select NODEMCU_CMODULE_UART
select NODEMCU_CMODULE_UART
select LUA_BUILTIN_DEBUG
select LUA_BUILTIN_DEBUG
choice LUA_INIT_STRING
prompt "Boot command"
default LUA_INIT_STRING_INIT_LUA
help
Command to run on boot. This can be a .lua file, an LFS module, or
any valid Lua expression. By default init.lua is loaded and run
from the SPIFFS filesystem.
config LUA_INIT_STRING_INIT_LUA
bool "init.lua from SPIFFS"
config LUA_INIT_STRING_INIT_LFS
bool "init module from LFS"
config LUA_INIT_STRING_CUSTOM
bool "Custom"
endchoice
config LUA_INIT_STRING_CUSTOM_STRING
string "Custom boot command" if LUA_INIT_STRING_CUSTOM
default ""
help
Run a custom command on boot.
Specify @filename.lua to load "filename.lua" from SPIFFS.
Specify node.LFS.get('foo')() to load the module "foo" from LFS.
Or specify any other valid Lua expression to execute that on boot.
config LUA_INIT_STRING
string
default "@init.lua" if LUA_INIT_STRING_INIT_LUA
default "node.LFS.get('init')()" if LUA_INIT_STRING_INIT_LFS
default LUA_INIT_STRING_CUSTOM_STRING if LUA_INIT_STRING_CUSTOM
endmenu
endmenu
components/lua/lua-5.3/lua.c
View file @
ed85e21a
...
@@ -30,11 +30,7 @@
...
@@ -30,11 +30,7 @@
#endif
#endif
#ifndef LUA_INIT_STRING
#ifndef LUA_INIT_STRING
# if defined(CONFIG_NODEMCU_EMBED_LFS)
# define LUA_INIT_STRING CONFIG_LUA_INIT_STRING
# define LUA_INIT_STRING "node.LFS.get('init')()"
# else
# define LUA_INIT_STRING "@init.lua"
# endif
#endif
#endif
#if !defined(STARTUP_COUNT)
#if !defined(STARTUP_COUNT)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment