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
d28a2c9e
Commit
d28a2c9e
authored
Mar 11, 2015
by
funshine
Browse files
add interger version release, fix #234, #252, #246
parent
113db6f4
Changes
5
Hide whitespace changes
Inline
Side-by-side
.travis.yml
View file @
d28a2c9e
...
@@ -16,7 +16,6 @@ script:
...
@@ -16,7 +16,6 @@ script:
-
cd bin/
-
cd bin/
-
file_name_integer="nodemcu_integer_${TRAVIS_TAG}.bin"
-
file_name_integer="nodemcu_integer_${TRAVIS_TAG}.bin"
-
srec_cat -output ${file_name_integer} -binary 0x00000.bin -binary -fill 0xff 0x00000 0x10000 0x10000.bin -binary -offset 0x10000
-
srec_cat -output ${file_name_integer} -binary 0x00000.bin -binary -fill 0xff 0x00000 0x10000 0x10000.bin -binary -offset 0x10000
-
ls
deploy
:
deploy
:
provider
:
releases
provider
:
releases
api_key
:
api_key
:
...
...
README.md
View file @
d28a2c9e
...
@@ -33,6 +33,12 @@ Tencent QQ group: 309957875<br />
...
@@ -33,6 +33,12 @@ Tencent QQ group: 309957875<br />
-
cross compiler (done)
-
cross compiler (done)
# Change log
# Change log
2015-03-11
<br
/>
fix bugs of spiffs.
<br
/>
build both float and integer version
[
latest releases
](
https://github.com/nodemcu/nodemcu-firmware/releases/latest
)
.
<br
/>
fix tmr.time().
<br
/>
fix memory leak when DNS fail.
2015-03-10
<br
/>
2015-03-10
<br
/>
update to the recent spiffs.
<br
/>
update to the recent spiffs.
<br
/>
add file.fsinfo() api, usage: remain, used, total = file.fsinfo().
<br
/>
add file.fsinfo() api, usage: remain, used, total = file.fsinfo().
<br
/>
...
...
app/include/user_version.h
View file @
d28a2c9e
...
@@ -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 2015031
0
"
#define BUILD_DATE "build 2015031
1
"
#endif
/* __USER_VERSION_H__ */
#endif
/* __USER_VERSION_H__ */
app/modules/net.c
View file @
d28a2c9e
...
@@ -200,10 +200,15 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
...
@@ -200,10 +200,15 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
return
;
return
;
}
}
if
(
nud
->
self_ref
==
LUA_NOREF
){
NODE_DBG
(
"self_ref null.
\n
"
);
return
;
}
if
(
ipaddr
==
NULL
)
if
(
ipaddr
==
NULL
)
{
{
NODE_ERR
(
"DNS Fail!
\n
"
);
NODE_ERR
(
"DNS Fail!
\n
"
);
return
;
goto
end
;
}
}
// ipaddr->addr is a uint32_t ip
// ipaddr->addr is a uint32_t ip
...
@@ -214,16 +219,12 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
...
@@ -214,16 +219,12 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
c_sprintf
(
ip_str
,
IPSTR
,
IP2STR
(
&
(
ipaddr
->
addr
)));
c_sprintf
(
ip_str
,
IPSTR
,
IP2STR
(
&
(
ipaddr
->
addr
)));
}
}
if
(
nud
->
self_ref
==
LUA_NOREF
){
NODE_DBG
(
"self_ref null.
\n
"
);
return
;
}
lua_rawgeti
(
gL
,
LUA_REGISTRYINDEX
,
nud
->
cb_dns_found_ref
);
// the callback function
lua_rawgeti
(
gL
,
LUA_REGISTRYINDEX
,
nud
->
cb_dns_found_ref
);
// the callback function
lua_rawgeti
(
gL
,
LUA_REGISTRYINDEX
,
nud
->
self_ref
);
// pass the userdata(conn) to callback func in lua
lua_rawgeti
(
gL
,
LUA_REGISTRYINDEX
,
nud
->
self_ref
);
// pass the userdata(conn) to callback func in lua
lua_pushstring
(
gL
,
ip_str
);
// the ip para
lua_pushstring
(
gL
,
ip_str
);
// the ip para
lua_call
(
gL
,
2
,
0
);
lua_call
(
gL
,
2
,
0
);
end:
if
((
pesp_conn
->
type
==
ESPCONN_TCP
&&
pesp_conn
->
proto
.
tcp
->
remote_port
==
0
)
if
((
pesp_conn
->
type
==
ESPCONN_TCP
&&
pesp_conn
->
proto
.
tcp
->
remote_port
==
0
)
||
(
pesp_conn
->
type
==
ESPCONN_UDP
&&
pesp_conn
->
proto
.
udp
->
remote_port
==
0
)
){
||
(
pesp_conn
->
type
==
ESPCONN_UDP
&&
pesp_conn
->
proto
.
udp
->
remote_port
==
0
)
){
lua_gc
(
gL
,
LUA_GCSTOP
,
0
);
lua_gc
(
gL
,
LUA_GCSTOP
,
0
);
...
@@ -597,12 +598,22 @@ static void socket_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
...
@@ -597,12 +598,22 @@ static void socket_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
NODE_DBG
(
"pesp_conn null.
\n
"
);
NODE_DBG
(
"pesp_conn null.
\n
"
);
return
;
return
;
}
}
lnet_userdata
*
nud
=
(
lnet_userdata
*
)
pesp_conn
->
reverse
;
if
(
nud
==
NULL
)
return
;
if
(
gL
==
NULL
)
return
;
if
(
ipaddr
==
NULL
)
if
(
ipaddr
==
NULL
)
{
{
dns_reconn_count
++
;
dns_reconn_count
++
;
if
(
dns_reconn_count
>=
5
){
if
(
dns_reconn_count
>=
5
){
NODE_ERR
(
"DNS Fail!
\n
"
);
NODE_ERR
(
"DNS Fail!
\n
"
);
lua_gc
(
gL
,
LUA_GCSTOP
,
0
);
if
(
nud
->
self_ref
!=
LUA_NOREF
){
luaL_unref
(
gL
,
LUA_REGISTRYINDEX
,
nud
->
self_ref
);
nud
->
self_ref
=
LUA_NOREF
;
// unref this, and the net.socket userdata will delete it self
}
lua_gc
(
gL
,
LUA_GCRESTART
,
0
);
return
;
return
;
}
}
NODE_ERR
(
"DNS retry %d!
\n
"
,
dns_reconn_count
);
NODE_ERR
(
"DNS retry %d!
\n
"
,
dns_reconn_count
);
...
...
examples/fragment.lua
View file @
d28a2c9e
...
@@ -370,3 +370,11 @@ for n,s in pairs(file.list()) do print(n.." size: "..s) end
...
@@ -370,3 +370,11 @@ for n,s in pairs(file.list()) do print(n.." size: "..s) end
file
.
remove
(
"test1.txt"
)
file
.
remove
(
"test1.txt"
)
for
n
,
s
in
pairs
(
file
.
list
())
do
print
(
n
..
" size: "
..
s
)
end
for
n
,
s
in
pairs
(
file
.
list
())
do
print
(
n
..
" size: "
..
s
)
end
file
.
open
(
"test2.txt"
,
"a+"
)
for
i
=
1
,
1
*
1000
do
file
.
write
(
"x"
)
end
file
.
close
()
print
(
"Done."
)
file
.
open
(
"test2.txt"
,
"a+"
)
for
i
=
1
,
1
*
1000
do
file
.
write
(
"x"
)
end
file
.
close
()
print
(
"Done."
)
function
TestDNSLeak
()
c
=
net
.
createConnection
(
net
.
TCP
,
0
)
c
:
connect
(
80
,
"bad-name.tlddfdf"
)
tmr
.
alarm
(
1
,
3000
,
0
,
function
()
print
(
"hack socket close, MEM: "
..
node
.
heap
())
c
:
close
()
end
)
-- socket timeout hack
print
(
"MEM: "
..
node
.
heap
())
end
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