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
9c0c960e
Commit
9c0c960e
authored
Mar 16, 2015
by
funshine
Browse files
json port from cjson. not work yet
parent
9818c506
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
app/Makefile
View file @
9c0c960e
...
@@ -36,7 +36,8 @@ SUBDIRS= \
...
@@ -36,7 +36,8 @@ SUBDIRS= \
smart
\
smart
\
wofs
\
wofs
\
modules
\
modules
\
spiffs
spiffs
\
cjson
endif
# } PDIR
endif
# } PDIR
...
@@ -84,6 +85,7 @@ COMPONENTS_eagle.app.v6 = \
...
@@ -84,6 +85,7 @@ COMPONENTS_eagle.app.v6 = \
smart/smart.a
\
smart/smart.a
\
wofs/wofs.a
\
wofs/wofs.a
\
spiffs/spiffs.a
\
spiffs/spiffs.a
\
cjson/libcjson.a
\
modules/libmodules.a
modules/libmodules.a
LINKFLAGS_eagle.app.v6
=
\
LINKFLAGS_eagle.app.v6
=
\
...
...
cjson
@
d59326b2
Subproject commit d59326b2d718e1a140b9b396ffe0a557b2d93fe0
app/include/user_modules.h
View file @
9c0c960e
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#define LUA_USE_BUILTIN_STRING // for string.xxx()
#define LUA_USE_BUILTIN_STRING // for string.xxx()
#define LUA_USE_BUILTIN_TABLE // for table.xxx()
#define LUA_USE_BUILTIN_TABLE // for table.xxx()
#define LUA_USE_BUILTIN_COROUTINE // for coroutine.xxx()
#define LUA_USE_BUILTIN_COROUTINE // for coroutine.xxx()
#define LUA_USE_BUILTIN_MATH // for math.xxx(), partially work
//
#define LUA_USE_BUILTIN_MATH // for math.xxx(), partially work
// #define LUA_USE_BUILTIN_IO // for io.xxx(), partially work
// #define LUA_USE_BUILTIN_IO // for io.xxx(), partially work
// #define LUA_USE_BUILTIN_OS // for os.xxx(), not work
// #define LUA_USE_BUILTIN_OS // for os.xxx(), not work
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#define LUA_USE_MODULES_COAP
#define LUA_USE_MODULES_COAP
#define LUA_USE_MODULES_U8G
#define LUA_USE_MODULES_U8G
#define LUA_USE_MODULES_WS2812
#define LUA_USE_MODULES_WS2812
#define LUA_USE_MODULES_CJSON
#endif
/* LUA_USE_MODULES */
#endif
/* LUA_USE_MODULES */
#endif
/* __USER_MODULES_H__ */
#endif
/* __USER_MODULES_H__ */
app/modules/Makefile
View file @
9c0c960e
...
@@ -47,6 +47,7 @@ INCLUDES += -I ../platform
...
@@ -47,6 +47,7 @@ INCLUDES += -I ../platform
INCLUDES
+=
-I
../wofs
INCLUDES
+=
-I
../wofs
INCLUDES
+=
-I
../spiffs
INCLUDES
+=
-I
../spiffs
INCLUDES
+=
-I
../smart
INCLUDES
+=
-I
../smart
INCLUDES
+=
-I
../cjson
PDIR
:=
../
$(PDIR)
PDIR
:=
../
$(PDIR)
sinclude
$(PDIR)Makefile
sinclude
$(PDIR)Makefile
app/modules/auxmods.h
View file @
9c0c960e
...
@@ -79,6 +79,9 @@ LUALIB_API int ( luaopen_file )( lua_State *L );
...
@@ -79,6 +79,9 @@ LUALIB_API int ( luaopen_file )( lua_State *L );
#define AUXLIB_OW "ow"
#define AUXLIB_OW "ow"
LUALIB_API
int
(
luaopen_ow
)(
lua_State
*
L
);
LUALIB_API
int
(
luaopen_ow
)(
lua_State
*
L
);
#define AUXLIB_CJSON "cjson"
LUALIB_API
int
(
luaopen_ow
)(
lua_State
*
L
);
// Helper macros
// Helper macros
#define MOD_CHECK_ID( mod, id )\
#define MOD_CHECK_ID( mod, id )\
if( !platform_ ## mod ## _exists( id ) )\
if( !platform_ ## mod ## _exists( id ) )\
...
...
app/modules/cjson.c
0 → 100644
View file @
9c0c960e
This diff is collapsed.
Click to expand it.
app/modules/file.c
View file @
9c0c960e
...
@@ -338,7 +338,7 @@ LUALIB_API int luaopen_file( lua_State *L )
...
@@ -338,7 +338,7 @@ LUALIB_API int luaopen_file( lua_State *L )
#if LUA_OPTIMIZE_MEMORY > 0
#if LUA_OPTIMIZE_MEMORY > 0
return
0
;
return
0
;
#else // #if LUA_OPTIMIZE_MEMORY > 0
#else // #if LUA_OPTIMIZE_MEMORY > 0
luaL_register
(
L
,
AUXLIB_
NOD
E
,
file_map
);
luaL_register
(
L
,
AUXLIB_
FIL
E
,
file_map
);
// Add constants
// Add constants
return
1
;
return
1
;
...
...
app/modules/modules.h
View file @
9c0c960e
...
@@ -141,6 +141,13 @@
...
@@ -141,6 +141,13 @@
#define ROM_MODULES_WS2812
#define ROM_MODULES_WS2812
#endif
#endif
#if defined(LUA_USE_MODULES_CJSON)
#define MODULES_CJSON "cjson"
#define ROM_MODULES_CJSON \
_ROM(MODULES_CJSON, luaopen_cjson, cjson_map)
#else
#define ROM_MODULES_CJSON
#endif
#define LUA_MODULES_ROM \
#define LUA_MODULES_ROM \
ROM_MODULES_GPIO \
ROM_MODULES_GPIO \
...
@@ -159,7 +166,8 @@
...
@@ -159,7 +166,8 @@
ROM_MODULES_UART \
ROM_MODULES_UART \
ROM_MODULES_OW \
ROM_MODULES_OW \
ROM_MODULES_BIT \
ROM_MODULES_BIT \
ROM_MODULES_WS2812
ROM_MODULES_WS2812 \
ROM_MODULES_CJSON
#endif
#endif
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