|
|
@@ -504,6 +504,10 @@ static void HMI_Decode(void)
|
|
|
LOG_I("停止一键测试!!!");
|
|
|
device_status.auto_test_sw=0;
|
|
|
}
|
|
|
+ else if (strstr(rx_buffer,"off_clear")!=NULL) {
|
|
|
+ LOG_I("关闭清扫!");
|
|
|
+ ctr_Collect_Fan(OFF);
|
|
|
+ }
|
|
|
//清扫
|
|
|
else if (strstr(rx_buffer,"clear")!=NULL) {
|
|
|
rt_kprintf("\n清扫!\n");
|
|
|
@@ -516,6 +520,8 @@ static void HMI_Decode(void)
|
|
|
}
|
|
|
else if (device_status.version_type==6) {
|
|
|
ctr_JD_Clear(ON);
|
|
|
+ }else if (device_status.version_type==5) {
|
|
|
+ ctr_Collect_Fan(ON);
|
|
|
}
|
|
|
}
|
|
|
//震动
|
|
|
@@ -542,8 +548,10 @@ static void HMI_Decode(void)
|
|
|
//打开灯管
|
|
|
else if (strstr(rx_buffer,"putTest.switchLamp=1")!=NULL)
|
|
|
{
|
|
|
+ if(device_status.temp_status==1)
|
|
|
+ rt_sprintf(device_status.tempture, "30");
|
|
|
device_status.test_flag=1;
|
|
|
- rt_kprintf("Open Lamp!\n");
|
|
|
+ LOG_I("Open Lamp!\n");
|
|
|
ctr_lamp(ON,1);
|
|
|
#if LAMP_EN == 1
|
|
|
ctr_lamp(ON,2);
|
|
|
@@ -1343,6 +1351,9 @@ static void HMI_Decode(void)
|
|
|
// ctr_Motor_Driver_Power(ON);
|
|
|
// ctr_xmove(400,200);//旋转清虫
|
|
|
device_status.autotakepic = 11;
|
|
|
+ }else if (strstr(rx_buffer,"cc_reset")!=NULL) {
|
|
|
+ device_status.autotakepic = 12;
|
|
|
+ HMI_WRITE("sysTest.result.txt=\"虫仓复位!\"");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1350,6 +1361,7 @@ static void HMI_Decode(void)
|
|
|
//入口函数-电机控制及
|
|
|
static void Ctr_Mortor_entry(void* parameter)
|
|
|
{
|
|
|
+ rt_thread_delay(1000);
|
|
|
rt_uint16_t num_up_open = 200; //20s
|
|
|
rt_uint16_t num_up_close = 200; //
|
|
|
rt_uint16_t num_down_open = 200; //
|
|
|
@@ -1360,6 +1372,11 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
//int current_t[200];
|
|
|
/*孢子仪拍照数量*/
|
|
|
rt_uint16_t photo_setup = 0;
|
|
|
+ if(device_status.version_type==5)
|
|
|
+ {
|
|
|
+ num_up_close = 100; //落虫
|
|
|
+ num_up_open = 50; //排水
|
|
|
+ }
|
|
|
while(1)
|
|
|
{
|
|
|
#if 1
|
|
|
@@ -1391,7 +1408,13 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
if (num_up_open == 0)
|
|
|
{
|
|
|
ctr_cangmen_up(OFF);
|
|
|
- num_up_open = 200;
|
|
|
+ if(device_status.version_type==5)
|
|
|
+ {
|
|
|
+ num_up_open = 50;
|
|
|
+ }else {
|
|
|
+ num_up_open = 200;
|
|
|
+ }
|
|
|
+
|
|
|
// bubblesort(current_t, 200);
|
|
|
// if(current_t[199]-motor_current<100&&device_status.clear_status==0&&device_status.work_status==1&&motor_current!=0&&motor_current<5000)
|
|
|
// {
|
|
|
@@ -1419,7 +1442,13 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
if (num_up_close == 0)
|
|
|
{
|
|
|
ctr_cangmen_up(OFF);
|
|
|
- num_up_close= 200;
|
|
|
+ if(device_status.version_type==5)
|
|
|
+ {
|
|
|
+ num_up_close= 100;
|
|
|
+ }else {
|
|
|
+ num_up_close= 200;
|
|
|
+ }
|
|
|
+
|
|
|
// bubblesort(current_t, 200);
|
|
|
// if(current_t[199]-motor_current<100&&device_status.clear_status==0&&device_status.work_status==1&&motor_current!=0&&motor_current<5000)
|
|
|
// {
|
|
|
@@ -1594,17 +1623,20 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
ef_set_env_blob("run_sta", &device_status.run_sta, sizeof(device_status.run_sta));
|
|
|
}
|
|
|
else if (device_status.autotakepic==10) {
|
|
|
- hwtimer2_pwm3_output(1,500000,1,0);
|
|
|
- //ctr_xmove(400,200);
|
|
|
+ //hwtimer2_pwm3_output(1,500000,1,0);
|
|
|
+ ctr_Motor86_move(13000,50,1);
|
|
|
device_status.autotakepic = 0;
|
|
|
}
|
|
|
|
|
|
else if (device_status.autotakepic==11) {
|
|
|
- hwtimer2_pwm3_output(1,500000,1,1);
|
|
|
- //ctr_xmove(400,200);
|
|
|
+ //hwtimer2_pwm3_output(1,500000,1,1);
|
|
|
+ ctr_Motor86_move(13000,50,0);
|
|
|
+ device_status.autotakepic = 0;
|
|
|
+ }
|
|
|
+ else if (device_status.autotakepic==12) {
|
|
|
+ ctr_Motor86_move(50000, 100, 0);
|
|
|
device_status.autotakepic = 0;
|
|
|
}
|
|
|
-
|
|
|
if(device_status.fsl_sw==1)
|
|
|
{
|
|
|
ctr_Petroleum_jelly(10);
|
|
|
@@ -2088,7 +2120,7 @@ void Check_ParamConfig(void)
|
|
|
connect_num++;
|
|
|
LOG_I("联网中......%d",connect_num);
|
|
|
//超时时间为3分钟
|
|
|
- #ifdef MATCH_DEVICE == 1
|
|
|
+ #if MATCH_DEVICE == 1
|
|
|
if(connect_num==30) //180
|
|
|
{
|
|
|
device_status.timeSwitch = 1;
|
|
|
@@ -2100,7 +2132,7 @@ void Check_ParamConfig(void)
|
|
|
break;
|
|
|
}
|
|
|
#else
|
|
|
- if(connect_num==180) //180
|
|
|
+ if(connect_num==30) //180
|
|
|
{
|
|
|
device_status.timeSwitch = 0;
|
|
|
LOG_W("Time not set:%04d-%02d-%02d %02d:%02d:%02d",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
|
|
|
@@ -2137,8 +2169,9 @@ void Check_ParamConfig(void)
|
|
|
{
|
|
|
Work_Loop_Task();
|
|
|
}
|
|
|
-
|
|
|
+ #if MATCH_DEVICE == 1
|
|
|
device_status.selfcheck_ws = 3;
|
|
|
+ #endif
|
|
|
#endif
|
|
|
}
|
|
|
}
|