Commit 9c0c960e authored by funshine's avatar funshine
Browse files

json port from cjson. not work yet

parent 9818c506
...@@ -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
...@@ -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__ */
...@@ -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
...@@ -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 ) )\
......
This diff is collapsed.
...@@ -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_NODE, file_map ); luaL_register( L, AUXLIB_FILE, file_map );
// Add constants // Add constants
return 1; return 1;
......
...@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment