Merge pull request #437 from dnc40085/dev096_adc.vdd33_fix
Added fix to adc.readvdd33() to prevent crashing in station mode
This commit is contained in:
commit
f7a6183853
|
@ -25,10 +25,22 @@ static int adc_readvdd33( lua_State* L )
|
||||||
{
|
{
|
||||||
uint32_t vdd33 = 0;
|
uint32_t vdd33 = 0;
|
||||||
|
|
||||||
os_intr_lock();
|
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();
|
vdd33 = readvdd33();
|
||||||
os_intr_unlock();
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vdd33 = readvdd33();
|
||||||
|
}
|
||||||
lua_pushinteger(L, vdd33);
|
lua_pushinteger(L, vdd33);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue