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
f2ea3df8
Commit
f2ea3df8
authored
Mar 03, 2016
by
TerryE
Browse files
Fix break in luac.cross build and add some documentation
parent
c55d21e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/include/module.h
View file @
f2ea3df8
...
...
@@ -67,7 +67,7 @@
const LOCK_IN_SECTION(".lua_rotable") \
luaR_table MODULE_PASTE_(lua_rotable_,name) = { luaname, map }
#if !(MIN_OPT_LEVEL==2 && LUA_OPTIMIZE_MEMORY==2)
#if
!defined(LUA_CROSS_COMPILER) &&
!(MIN_OPT_LEVEL==2 && LUA_OPTIMIZE_MEMORY==2)
# error "NodeMCU modules must be built with LTR enabled (MIN_OPT_LEVEL=2 and LUA_OPTIMIZE_MEMORY=2)"
#endif
...
...
app/modules/linit.c
View file @
f2ea3df8
...
...
@@ -57,7 +57,12 @@ extern const luaR_entry math_map[];
BUILTIN_LIB
(
MATH
,
LUA_MATHLIBNAME
,
math_map
);
#endif
#ifdef LUA_CROSS_COMPILER
const
luaL_Reg
lua_libs
[]
=
{{
NULL
,
NULL
}};
const
luaR_table
lua_rotable
[]
=
{{
NULL
,
NULL
}};
#else
extern
const
luaL_Reg
lua_libs
[];
#endif
void
luaL_openlibs
(
lua_State
*
L
)
{
const
luaL_Reg
*
lib
=
lua_libs
;
...
...
docs/en/upload.md
View file @
f2ea3df8
...
...
@@ -35,4 +35,23 @@ Supported platforms: Windows
Source:
[
https://github.com/4refr0nt/luatool
](
https://github.com/4refr0nt/luatool
)
Supported platforms: OS X, Linux, Windows, anything that runs Python
\ No newline at end of file
Supported platforms: OS X, Linux, Windows, anything that runs Python
# Compiling Lua on your PC for Uploading
If you install lua on your development PC or Laptop then you can use the standard Lua
compiler to syntax check any Lua source before downloading it to the ESP8266 module. However,
the nodemcu compiler output uses different data types (e.g. it supports ROMtables) so the
compiled output cannot run on the ESP8266.
Compiling source on one platform for use on another (e.g. Intel x38 Window to ESP8266) is
known as _cross-compilation_ and the nodemcu firmware supports the compilation of
`luac.cross`
on
\*
nix patforms which have Lua 5.1, the Lua filesystem module (lfs), and the essential
GCC tools. Simply change directory to the firmware root directoy and run the command:
lua tools/cross-lua.lua
This will generate a
`luac.cross`
executable in your root directory which can be used to
compile and to syntax-check Lua source on the Development machine for execution under
nodemcu lua on the ESP8266.
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