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
378398d4
Commit
378398d4
authored
Feb 15, 2015
by
HuangRui
Browse files
Merge branch 'dev' of
https://github.com/nodemcu/nodemcu-firmware
parents
0232c13b
1798c6b7
Changes
11
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
378398d4
...
...
@@ -24,8 +24,8 @@ Tencent QQ group: 309957875<br />
-
fix wifi smart connect
-
add spi module (done)
-
add mqtt module (done)
-
add coap module
-
cross compiler
-
add coap module
(in coap branch)
-
cross compiler
(done)
# Change log
2015-02-13
<br
/>
...
...
app/include/user_config.h
View file @
378398d4
...
...
@@ -7,7 +7,7 @@
#define NODE_VERSION_INTERNAL 0U
#define NODE_VERSION "NodeMCU 0.9.5"
#define BUILD_DATE "build 2015021
3
"
#define BUILD_DATE "build 2015021
4
"
// #define DEVKIT_VERSION_0_9 1 // define this only if you use NodeMCU devkit v0.9
...
...
app/lua/lauxlib.c
View file @
378398d4
...
...
@@ -692,6 +692,8 @@ LUALIB_API int luaL_loadfsfile (lua_State *L, const char *filename) {
lf
.
f
=
fs_open
(
filename
,
FS_RDONLY
);
if
(
lf
.
f
<
FS_OPEN_OK
)
return
errfsfile
(
L
,
"open"
,
fnameindex
);
}
// if(fs_size(lf.f)>LUAL_BUFFERSIZE)
// return luaL_error(L, "file is too big");
c
=
fs_getc
(
lf
.
f
);
if
(
c
==
'#'
)
{
/* Unix exec. file? */
lf
.
extraline
=
1
;
...
...
app/lua/luaconf.h
View file @
378398d4
...
...
@@ -542,7 +542,7 @@ extern int readline4lua(const char *prompt, char *buffer, int length);
/*
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
*/
#define LUAL_BUFFERSIZE (BUFSIZ*4)
#define LUAL_BUFFERSIZE
(
(BUFSIZ
)
*4)
/* }================================================================== */
...
...
app/modules/net.c
View file @
378398d4
...
...
@@ -1241,6 +1241,31 @@ static int net_socket_unhold( lua_State* L )
return
0
;
}
// Lua: ip,port = sk:getpeer()
static
int
net_socket_getpeer
(
lua_State
*
L
)
{
lnet_userdata
*
nud
;
const
char
*
mt
=
"net.socket"
;
nud
=
(
lnet_userdata
*
)
luaL_checkudata
(
L
,
1
,
mt
);
luaL_argcheck
(
L
,
nud
,
1
,
"Server/Socket expected"
);
if
(
nud
!=
NULL
&&
nud
->
pesp_conn
!=
NULL
){
char
temp
[
20
]
=
{
0
};
c_sprintf
(
temp
,
IPSTR
,
IP2STR
(
&
(
nud
->
pesp_conn
->
proto
.
tcp
->
remote_ip
)
)
);
if
(
nud
->
pesp_conn
->
proto
.
tcp
->
remote_port
!=
0
)
{
lua_pushstring
(
L
,
temp
);
lua_pushinteger
(
L
,
nud
->
pesp_conn
->
proto
.
tcp
->
remote_port
);
}
else
{
lua_pushnil
(
L
);
lua_pushnil
(
L
);
}
}
else
{
lua_pushnil
(
L
);
lua_pushnil
(
L
);
}
return
2
;
}
// Lua: socket:dns( string, function(ip) )
static
int
net_socket_dns
(
lua_State
*
L
)
{
...
...
@@ -1302,6 +1327,7 @@ static const LUA_REG_TYPE net_socket_map[] =
{
LSTRKEY
(
"hold"
),
LFUNCVAL
(
net_socket_hold
)
},
{
LSTRKEY
(
"unhold"
),
LFUNCVAL
(
net_socket_unhold
)
},
{
LSTRKEY
(
"dns"
),
LFUNCVAL
(
net_socket_dns
)
},
{
LSTRKEY
(
"getpeer"
),
LFUNCVAL
(
net_socket_getpeer
)
},
// { LSTRKEY( "delete" ), LFUNCVAL ( net_socket_delete ) },
{
LSTRKEY
(
"__gc"
),
LFUNCVAL
(
net_socket_delete
)
},
#if LUA_OPTIMIZE_MEMORY > 0
...
...
app/platform/flash_fs.h
View file @
378398d4
...
...
@@ -69,6 +69,7 @@
#define fs_format myspiffs_format
#define fs_check myspiffs_check
#define fs_rename myspiffs_rename
#define fs_size myspiffs_size
#define FS_NAME_MAX_LENGTH SPIFFS_OBJ_NAME_LEN
...
...
app/spiffs/spiffs.c
View file @
378398d4
...
...
@@ -165,6 +165,9 @@ void myspiffs_clearerr( int fd ){
int
myspiffs_rename
(
const
char
*
old
,
const
char
*
newname
){
return
SPIFFS_rename
(
&
fs
,
(
char
*
)
old
,
(
char
*
)
newname
);
}
size_t
myspiffs_size
(
int
fd
){
return
SPIFFS_size
(
&
fs
,
(
spiffs_file
)
fd
);
}
#if 0
void test_spiffs() {
char buf[12];
...
...
app/spiffs/spiffs.h
View file @
378398d4
...
...
@@ -423,6 +423,7 @@ s32_t SPIFFS_check(spiffs *fs);
*/
s32_t
SPIFFS_eof
(
spiffs
*
fs
,
spiffs_file
fh
);
s32_t
SPIFFS_tell
(
spiffs
*
fs
,
spiffs_file
fh
);
s32_t
SPIFFS_size
(
spiffs
*
fs
,
spiffs_file
fh
);
#if SPIFFS_TEST_VISUALISATION
/**
...
...
@@ -465,5 +466,6 @@ int myspiffs_error( int fd );
void
myspiffs_clearerr
(
int
fd
);
int
myspiffs_check
(
void
);
int
myspiffs_rename
(
const
char
*
old
,
const
char
*
newname
);
size_t
myspiffs_size
(
int
fd
);
#endif
/* SPIFFS_H_ */
app/spiffs/spiffs_hydrogen.c
View file @
378398d4
...
...
@@ -798,6 +798,25 @@ s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh) {
return
res
;
}
s32_t
SPIFFS_size
(
spiffs
*
fs
,
spiffs_file
fh
)
{
SPIFFS_API_CHECK_MOUNT
(
fs
);
SPIFFS_LOCK
(
fs
);
spiffs_fd
*
fd
;
s32_t
res
;
res
=
spiffs_fd_get
(
fs
,
fh
,
&
fd
);
SPIFFS_API_CHECK_RES
(
fs
,
res
);
#if SPIFFS_CACHE_WR
spiffs_fflush_cache
(
fs
,
fh
);
#endif
res
=
fd
->
size
;
SPIFFS_UNLOCK
(
fs
);
return
res
;
}
#if SPIFFS_TEST_VISUALISATION
s32_t
SPIFFS_vis
(
spiffs
*
fs
)
{
s32_t
res
=
SPIFFS_OK
;
...
...
pre_build/0.9.5/nodemcu_20150213.bin
0 → 100644
View file @
378398d4
File added
pre_build/latest/nodemcu_latest.bin
View file @
378398d4
No preview for this file type
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