From fc8fa2cc915aea3687b068eb0355bb84b2fc113d Mon Sep 17 00:00:00 2001 From: HuangRui Date: Tue, 19 May 2015 20:11:15 +0800 Subject: [PATCH] Fixed readvdd33 bug. --- app/modules/adc.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/app/modules/adc.c b/app/modules/adc.c index eee15fe4..72e1e6a0 100644 --- a/app/modules/adc.c +++ b/app/modules/adc.c @@ -24,17 +24,10 @@ static int adc_sample( lua_State* L ) static int adc_readvdd33( lua_State* L ) { uint32_t vdd33 = 0; - if(STATION_MODE == wifi_get_opmode()) - { - // Bug fix - wifi_set_opmode( STATIONAP_MODE ); - vdd33 = readvdd33(); - wifi_set_opmode( STATION_MODE ); - } - else - { - vdd33 = readvdd33(); - } + + os_intr_lock(); + vdd33 = readvdd33(); + os_intr_unlock(); lua_pushinteger(L, vdd33); return 1;