Commit a7070926 authored by funshine's avatar funshine
Browse files

merge cjson and dev to master, make a stable release

parent a01bda03
...@@ -23,8 +23,9 @@ Tencent QQ group: 309957875<br /> ...@@ -23,8 +23,9 @@ Tencent QQ group: 309957875<br />
- Easy to access wireless router - Easy to access wireless router
- Based on Lua 5.1.4 (without *debug, os* module.) - Based on Lua 5.1.4 (without *debug, os* module.)
- Event-Drive programming preferred. - Event-Drive programming preferred.
- Build-in file, timer, pwm, i2c, spi, 1-wire, net, mqtt, coap, gpio, wifi, adc, uart and system api. - Build-in json, file, timer, pwm, i2c, spi, 1-wire, net, mqtt, coap, gpio, wifi, adc, uart and system api.
- GPIO pin re-mapped, use the index to access gpio, i2c, pwm. - GPIO pin re-mapped, use the index to access gpio, i2c, pwm.
- Both Integer(less memory usage) and Float version firmware provided.
# To Do List (pull requests are very welcomed) # To Do List (pull requests are very welcomed)
- loadable c module - loadable c module
...@@ -35,9 +36,13 @@ Tencent QQ group: 309957875<br /> ...@@ -35,9 +36,13 @@ Tencent QQ group: 309957875<br />
- cross compiler (done) - cross compiler (done)
# Change log # Change log
2015-03-18<br />
update u8glib.<br />
merge everything to master.
2015-03-17<br /> 2015-03-17<br />
add cjson module, only cjson.encode() and cjson.decode() is implemented.<br /> add cjson module, only cjson.encode() and cjson.decode() is implemented.<br />
read doc [here](https://github.com/nodemcu/nodemcu-firmware/blob/json/app/cjson/manual.txt) read doc [here](https://github.com/nodemcu/nodemcu-firmware/blob/master/app/cjson/manual.txt)
2015-03-15<br /> 2015-03-15<br />
bugs fixed: #239, #273.<br /> bugs fixed: #239, #273.<br />
...@@ -63,32 +68,6 @@ raise internal LUA_BUFFERSIZE from 1024 to 4096.<br /> ...@@ -63,32 +68,6 @@ raise internal LUA_BUFFERSIZE from 1024 to 4096.<br />
lua require("mod") will load "mod.lc" file first if exist.<br /> lua require("mod") will load "mod.lc" file first if exist.<br />
build latest pre_build bin. build latest pre_build bin.
2015-02-12<br />
fix float print.<br />
update spiffs, add file.rename api to file module.<br />
fix some file system bug. need more tests.<br />
add support to 8Mbyte, 16Mbyte flash.<br />
remove node.led() and node.key() api.<br />
some update to lua_modules and examples.<br />
build latest pre_build bin.
2015-01-27<br />
support floating point LUA.<br />
use macro LUA_NUMBER_INTEGRAL in user_config.h control this feature.<br />
LUA_NUMBER_INTEGRAL to disable floating point support,<br />
// LUA_NUMBER_INTEGRAL to enable floating point support.<br />
fix tmr.time(). #132<br />
fix filesystem length. #113<br />
fix ssl reboots. #134<br />
build pre_build bin.
2015-01-26<br />
applied sdk095_patch1 to sdk 0.9.5.<br />
added LUA examples and modules [by dvv](https://github.com/dvv). <br />
added node.readvdd33() API [by alonewolfx2](https://github.com/alonewolfx2).<br />
build pre_build bin.
[more change log](https://github.com/nodemcu/nodemcu-firmware/wiki)<br /> [more change log](https://github.com/nodemcu/nodemcu-firmware/wiki)<br />
##GPIO NEW TABLE ( Build 20141219 and later) ##GPIO NEW TABLE ( Build 20141219 and later)
...@@ -154,9 +133,10 @@ build pre_build bin. ...@@ -154,9 +133,10 @@ build pre_build bin.
#define LUA_USE_MODULES_OW #define LUA_USE_MODULES_OW
#define LUA_USE_MODULES_BIT #define LUA_USE_MODULES_BIT
#define LUA_USE_MODULES_MQTT #define LUA_USE_MODULES_MQTT
// #define LUA_USE_MODULES_COAP // need about 4k more ram for now // #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 */
``` ```
...@@ -470,3 +450,17 @@ cc = coap.Client() ...@@ -470,3 +450,17 @@ cc = coap.Client()
cc:get(coap.CON, "coap://192.168.18.100:5683/.well-known/core") cc:get(coap.CON, "coap://192.168.18.100:5683/.well-known/core")
cc:post(coap.NON, "coap://192.168.18.100:5683/", "Hello") cc:post(coap.NON, "coap://192.168.18.100:5683/", "Hello")
``` ```
####cjson
```lua
-- Translate Lua value to/from JSON
-- text = cjson.encode(value)
-- value = cjson.decode(text)
json_text = '[ true, { "foo": "bar" } ]'
value = cjson.decode(json_text)
-- Returns: { true, { foo = "bar" } }
value = { true, { foo = "bar" } }
json_text = cjson.encode(value)
-- Returns: '[true,{"foo":"bar"}]'
```
...@@ -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
......
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
#define NODE_VERSION_INTERNAL 0U #define NODE_VERSION_INTERNAL 0U
#define NODE_VERSION "NodeMCU 0.9.5" #define NODE_VERSION "NodeMCU 0.9.5"
#define BUILD_DATE "build 20150317" #define BUILD_DATE "build 20150318"
#endif /* __USER_VERSION_H__ */ #endif /* __USER_VERSION_H__ */
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define c_strncmp os_strncmp #define c_strncmp os_strncmp
#define c_strncpy os_strncpy #define c_strncpy os_strncpy
// #define c_strstr os_strstr // #define c_strstr os_strstr
#define c_strncasecmp strncasecmp #define c_strncasecmp c_strncmp
#define c_strstr strstr #define c_strstr strstr
#define c_strncat strncat #define c_strncat strncat
......
pwm.setup(0,500,50) pwm.setup(1,500,50) pwm.setup(2,500,50) pwm.setup(0,500,50) pwm.setup(1,500,50) pwm.setup(2,500,50)
pwm.start(0) pwm.start(1) pwm.start(2) pwm.start(0) pwm.start(1) pwm.start(2)
function led(r,g,b) pwm.setduty(0,g) pwm.setduty(1,b) pwm.setduty(2,r) end function led(r,g,b) pwm.setduty(0,g) pwm.setduty(1,b) pwm.setduty(2,r) end
wifi.station.autoconnect(1) wifi.sta.autoconnect(1)
a=0 a=0
tmr.alarm( 1000,1,function() if a==0 then a=1 led(50,50,50) else a=0 led(0,0,0) end end) tmr.alarm( 1000,1,function() if a==0 then a=1 led(50,50,50) else a=0 led(0,0,0) end end)
......
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