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
106841c2
Commit
106841c2
authored
May 08, 2018
by
dnc40085
Committed by
Marcel Stör
May 08, 2018
Browse files
Add message indicating that node.sleep() was disabled during build. (#2367)
parent
6a261aec
Changes
1
Show whitespace changes
Inline
Side-by-side
app/modules/node.c
View file @
106841c2
...
@@ -108,13 +108,18 @@ static int node_sleep( lua_State* L )
...
@@ -108,13 +108,18 @@ static int node_sleep( lua_State* L )
cfg
.
resume_cb_ptr
=
&
node_sleep_resume_cb
;
cfg
.
resume_cb_ptr
=
&
node_sleep_resume_cb
;
pmSleep_suspend
(
&
cfg
);
pmSleep_suspend
(
&
cfg
);
#else
#else
c
_printf
(
"
\n
The option
\"
timer_suspend_enable
\"
in
\"
app/include/user_config.h
\"
was disabled during FW build!
\n
"
);
dbg
_printf
(
"
\n
The option
\"
TIMER_SUSPEND_ENABLE
\"
in
\"
app/include/user_config.h
\"
was disabled during FW build!
\n
"
);
return
luaL_error
(
L
,
"
light
sleep is unavailable"
);
return
luaL_error
(
L
,
"
node.
sleep
()
is unavailable"
);
#endif
#endif
return
0
;
return
0
;
}
}
#else
static
int
node_sleep
(
lua_State
*
L
)
{
dbg_printf
(
"
\n
The options
\"
TIMER_SUSPEND_ENABLE
\"
and
\"
PMSLEEP_ENABLE
\"
in
\"
app/include/user_config.h
\"
were disabled during FW build!
\n
"
);
return
luaL_error
(
L
,
"node.sleep() is unavailable"
);
}
#endif //PMSLEEP_ENABLE
#endif //PMSLEEP_ENABLE
static
int
node_info
(
lua_State
*
L
)
static
int
node_info
(
lua_State
*
L
)
{
{
lua_pushinteger
(
L
,
NODE_VERSION_MAJOR
);
lua_pushinteger
(
L
,
NODE_VERSION_MAJOR
);
...
@@ -600,8 +605,8 @@ static const LUA_REG_TYPE node_map[] =
...
@@ -600,8 +605,8 @@ static const LUA_REG_TYPE node_map[] =
{
LSTRKEY
(
"restart"
),
LFUNCVAL
(
node_restart
)
},
{
LSTRKEY
(
"restart"
),
LFUNCVAL
(
node_restart
)
},
{
LSTRKEY
(
"dsleep"
),
LFUNCVAL
(
node_deepsleep
)
},
{
LSTRKEY
(
"dsleep"
),
LFUNCVAL
(
node_deepsleep
)
},
{
LSTRKEY
(
"dsleepMax"
),
LFUNCVAL
(
dsleepMax
)
},
{
LSTRKEY
(
"dsleepMax"
),
LFUNCVAL
(
dsleepMax
)
},
#ifdef PMSLEEP_ENABLE
{
LSTRKEY
(
"sleep"
),
LFUNCVAL
(
node_sleep
)
},
{
LSTRKEY
(
"sleep"
),
LFUNCVAL
(
node_sleep
)
},
#ifdef PMSLEEP_ENABLE
PMSLEEP_INT_MAP
,
PMSLEEP_INT_MAP
,
#endif
#endif
{
LSTRKEY
(
"info"
),
LFUNCVAL
(
node_info
)
},
{
LSTRKEY
(
"info"
),
LFUNCVAL
(
node_info
)
},
...
...
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