|
uint16 temp=750;
uint16 dianya,dianya2,dianya3;
uint8 js_time=1;
uint8 dianya2_time=1;
uint8 dianya3_time=1;
bool zt;
#define USER_TIME_MS 4000 ///< 定时时间,单位:毫秒
LOCAL os_timer_t userTimer;
void ICACHE_FLASH_ATTR userTimerFunc(void)
{
system_soft_wdt_stop();
dianya=system_adc_read();
currentDataPoint.valueshidu=dianya;
os_printf("\r\nShidu1:%d",dianya);
system_soft_wdt_feed();
if(dianya>temp)
{
os_delay_us(1000*1000*dianya2_time);
dianya2=system_adc_read();
os_printf("\r\nShidu2:%d",dianya2);
if(dianya2>temp)
{
os_delay_us(1000*1000*dianya3_time);
dianya3=system_adc_read();
os_printf("\r\nShidu3:%d",dianya3);
if(dianya3>temp)
{
gpio_output_set(BIT5,0,BIT5,0);
os_delay_us(1000*1000*js_time);
currentDataPoint.valuejshui_zt=GPIO_INPUT_GET(GPIO_ID_PIN(5));
os_printf("\r\nJS_ing:%d",GPIO_INPUT_GET(GPIO_ID_PIN(5)));
gpio_output_set(0,BIT5,BIT5,0);
os_printf("\r\nJS_ing:%d",GPIO_INPUT_GET(GPIO_ID_PIN(5)));
}
else
{
currentDataPoint.valuejshui_zt=GPIO_INPUT_GET(GPIO_ID_PIN(5));
}
}
else
{
currentDataPoint.valuejshui_zt=GPIO_INPUT_GET(GPIO_ID_PIN(5));
}
}
else
{
currentDataPoint.valuejshui_zt=GPIO_INPUT_GET(GPIO_ID_PIN(5));
}
system_soft_wdt_restart();
system_os_post(USER_TASK_PRIO_0, SIG_UPGRADE_DATA, 0);
}
void ICACHE_FLASH_ATTR user_init(void)
{
\\主程序中只添加了这个写语句,其他默认不变。
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO5_U, FUNC_GPIO5);
system_soft_wdt_feed();
os_timer_disarm(&userTimer);
os_timer_setfn(&userTimer, (os_timer_func_t *)userTimerFunc, NULL);
os_timer_arm(&userTimer, USER_TIME_MS, 1);
os_printf("--- system_free_size = %d ---\n", system_get_free_heap_size());
}
以下是重启串口输出信息:
rl?l?b|巶?抮抌?b岒nn瀕nn溾?bp寧lrlrlp騨??lbn鈢??b岒nn?l寧l`?nnl`nr帓抧拻l`p騨?r寽溾?bn鈢鞄帋b岒nn?l`?nnl`nr帓抧?lp騨?r寽溾囔lbn鈢寧?b岒nn?l`?nnl`nr帓抧?l`r拻n?l`rl寣n湆騨n瀸炩宺nnn?l宐?l?抣寪n鄮n鞉n~寣ll鄝b鞂llpb?br倢靗`nl巔岇l`bl`l?抧瀗寬鈔l瀨bll`rl---------------SDK version:2.0.0(5a875ba)--------------
system_get_free_heap_size=36688
reset reason: 6
---UPGRADE_FW_BIN1---
gpio_name 0
gpio_name 14
[Dev] Get GAgent config data from master eare.
[Dev] Save gagent config data
[Dev] Domain:api.gizwits.com:80.
[Dev] tz in sec:28800,timezone:8.0
[NWK] NWK_WIFI_ONBOARDING_UP
SC version: V2.5.4
[WiFiEvent] OpenAirlink...
[GAgent] GAgent Start...
[Local]
----------------------------------------- GAGENT INFO --------------------------------------
[Local] GAgent Product Soft Version: 04020021. Hard Version: 00ESP826
[Local] GAgent Compiled Time: Mar 1 2017, 14:15:23.
[Local] GAgent cache first ssid , key .
[Local] GAgent backup ssid , key .
[Local] GAgent mac :A020A6064656
[Local] GAgent passcode :MVAEOGMHPX len=10
[Local] GAgent did : len:0
[Local] GAgent old passcode:
[Local] GAgent old did : len:0
[Local] GAgent old pk :711f6f0f0a054ed3a1**** len:32
[Local] GAgent AP name:XPG-GAgent-4656
[Local] GAgent 3rd cloud :
[Local] GAgent M2M Host : , IP :0.0.0.0
[Local] GAgent GService Host : , Port :0 , IP :0.0.0.0
[Local] GAgent BizLogLev:00,SysLogLev:00
[Local] --------------------------------------------------------------------------------------
[Local] GAgent get local info ok.
[Local] MCU Protocol Vertion:00000004.
[Local] MCU P0 Vertion:00000002.
[Local] MCU Hard Vertion:03000001.
[Local] MCU Soft Vertion:03000003.
[Local] MCU old product_key:711f6f0f0a054ed3a1****.
[Local] MCU product_key:711f6f0f0a054ed3a1****.
[Local] MCU passcodeEnableTime:0 s.
[Local] GAgent Soft Version: 04020420. Hard Version: 00ESP826.
gizwitsInit OK
--- system_free_size = 26720 ---
mode : sta(a0:20:a6:06:46:56)
add if0
Fatal exception 9(LoadStoreAlignmentCause):
epc1=0x4020145f, epc2=0x00000000, epc3=0x00000000, excvaddr=0x4010045b, depc=0x00000000
ets Jan 8 2013,rst cause:2, boot mode3,6)
load 0x40100000, len 2408, room 16
tail 8
chksum 0xe5
load 0x3ffe8000, len 776, room 0
tail 8
chksum 0x84
load 0x3ffe8310, len 632, room 0
tail 8
chksum 0xd8
csum 0xd8
2nd boot version : 1.6
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000
---------------SDK version:2.0.0(5a875ba)--------------
system_get_free_heap_size=36688
reset reason: 2
Fatal exception (9):
epc1=0x4020145f, epc2=0x00000000, epc3=0x00000000, excvaddr=0x4010045b, depc=0x00000000
---UPGRADE_FW_BIN1---
gpio_name 0
gpio_name 14
[Dev] Get gagent config data from master eare.
[Dev] Save gagent config data
[Dev] Domain:api.gizwits.com:80.
[Dev] tz in sec:28800,timezone:8.0
[NWK] NWK_WIFI_ONBOARDING_UP
SC version: V2.5.4
[WiFiEvent] OpenAirlink...
[GAgent] GAgent Start...
[Local]
----------------------------------------- GAGENT INFO --------------------------------------
[Local] GAgent Product Soft Version: 04020021. Hard Version: 00ESP826
[Local] GAgent Compiled Time: Mar 1 2017, 14:15:23.
[Local] GAgent cache first ssid , key .
[Local] GAgent backup ssid , key .
[Local] GAgent mac :A020A6064656
[Local] GAgent passcode :MVAEOGMHPX len=10
[Local] GAgent did : len:0
[Local] GAgent old passcode:
[Local] GAgent old did : len:0
[Local] GAgent old pk :711f6f0f0a054ed3a1**** len:32
[Local] GAgent AP name:XPG-GAgent-4656
[Local] GAgent 3rd cloud :
[Local] GAgent M2M Host : , IP :0.0.0.0
[Local] GAgent GService Host : , Port :0 , IP :0.0.0.0
[Local] GAgent BizLogLev:00,SysLogLev:00
[Local] --------------------------------------------------------------------------------------
[Local] GAgent get local info ok.
[Local] MCU Protocol Vertion:00000004.
[Local] MCU P0 Vertion:00000002.
[Local] MCU Hard Vertion:03000001.
[Local] MCU Soft Vertion:03000003.
[Local] MCU old product_key:711f6f0f0a054ed3a1****.
[Local] MCU product_key:711f6f0f0a054ed3a1****.
[Local] MCU passcodeEnableTime:0 s.
[Local] GAgent Soft Version: 04020420. Hard Version: 00ESP826.
gizwitsInit OK
--- system_free_size = 26720 ---
mode : sta(a0:20:a6:06:46:56)
add if0
ets Jan 8 2013,rst cause:4, boot mode3,6)
wdt reset
load 0x40100000, len 2408, room 16
tail 8
chksum 0xe5
load 0x3ffe8000, len 776, room 0
tail 8
chksum 0x84
load 0x3ffe8310, len 632, room 0
tail 8
chksum 0xd8
csum 0xd8
2nd boot version : 1.6
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000
|
|