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
00e2adcc
Commit
00e2adcc
authored
Jan 29, 2015
by
Vowstar
Browse files
Merge pull request #143 from alonewolfx2/master
new sleep set options added (from 0.9.5 sdk)
parents
db5614a0
f4214294
Changes
1
Show whitespace changes
Inline
Side-by-side
app/modules/node.c
View file @
00e2adcc
...
...
@@ -26,12 +26,24 @@ static int node_deepsleep( lua_State* L )
{
s32
us
;
us
=
luaL_checkinteger
(
L
,
1
);
if
(
us
<=
0
)
// if ( us <= 0 )
if
(
us
<
0
)
return
luaL_error
(
L
,
"wrong arg range"
);
system_deep_sleep
(
us
);
return
0
;
}
// Lua: dsleep_set_options
static
int
node_deepsleep_setoption
(
lua_State
*
L
)
{
s32
option
;
option
=
luaL_checkinteger
(
L
,
1
);
if
(
option
<
0
||
option
>
4
)
return
luaL_error
(
L
,
"wrong arg range"
);
else
deep_sleep_set_option
(
option
);
return
0
;
}
// Lua: info()
static
int
node_info
(
lua_State
*
L
)
{
...
...
@@ -295,6 +307,7 @@ const LUA_REG_TYPE node_map[] =
{
LSTRKEY
(
"input"
),
LFUNCVAL
(
node_input
)
},
{
LSTRKEY
(
"output"
),
LFUNCVAL
(
node_output
)
},
{
LSTRKEY
(
"readvdd33"
),
LFUNCVAL
(
node_readvdd33
)
},
{
LSTRKEY
(
"dsleepsetoption"
),
LFUNCVAL
(
node_deepsleep_setoption
)
},
#if LUA_OPTIMIZE_MEMORY > 0
#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