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
dd00e310
Commit
dd00e310
authored
May 22, 2015
by
dnc40085
Browse files
Added fix to adc.readvdd33() to prevent crashing in station mode while
connected
parent
fc8fa2cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/adc.c
View file @
dd00e310
...
@@ -24,11 +24,23 @@ static int adc_sample( lua_State* L )
...
@@ -24,11 +24,23 @@ static int adc_sample( lua_State* L )
static
int
adc_readvdd33
(
lua_State
*
L
)
static
int
adc_readvdd33
(
lua_State
*
L
)
{
{
uint32_t
vdd33
=
0
;
uint32_t
vdd33
=
0
;
os_intr_lock
();
vdd33
=
readvdd33
();
os_intr_unlock
();
if
(
STATION_MODE
==
wifi_get_opmode
())
{
// Bug fix
if
(
wifi_station_get_connect_status
()
!=
0
)
{
return
luaL_error
(
L
,
"Can't read vdd33 while station is connected"
);
}
else
{
vdd33
=
readvdd33
();
}
}
else
{
vdd33
=
readvdd33
();
}
lua_pushinteger
(
L
,
vdd33
);
lua_pushinteger
(
L
,
vdd33
);
return
1
;
return
1
;
}
}
...
...
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