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
2ff1324d
Commit
2ff1324d
authored
Jan 12, 2016
by
Terry Ellison
Browse files
Merge pull request #924 from DiUS/rst-info
Expose extended reset info via node.bootreason().
parents
e9f16d1a
57917601
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/node.c
View file @
2ff1324d
...
...
@@ -472,8 +472,20 @@ static int node_setcpufreq(lua_State* L)
// Lua: code = bootreason()
static
int
node_bootreason
(
lua_State
*
L
)
{
struct
rst_info
*
ri
=
system_get_rst_info
();
lua_pushnumber
(
L
,
rtc_get_reset_reason
());
return
1
;
lua_pushnumber
(
L
,
ri
->
reason
);
if
(
ri
->
reason
==
REASON_EXCEPTION_RST
)
{
lua_pushnumber
(
L
,
ri
->
epc1
);
lua_pushnumber
(
L
,
ri
->
epc2
);
lua_pushnumber
(
L
,
ri
->
epc3
);
lua_pushnumber
(
L
,
ri
->
excvaddr
);
lua_pushnumber
(
L
,
ri
->
depc
);
return
7
;
}
else
return
2
;
}
// Lua: restore()
...
...
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