|
|
@@ -1543,121 +1543,26 @@ static void Control_Check_thread_entry(void *parameter)
|
|
|
{
|
|
|
if(device_status.update_flag==1) break;
|
|
|
if(device_status.version_type==5) break;
|
|
|
+ if(device_status.selfcheck_ws==2)
|
|
|
{
|
|
|
-
|
|
|
- if(device_status.selfcheck_ws==2)
|
|
|
+ while(current_second <= total_seconds)
|
|
|
{
|
|
|
- while(current_second <= total_seconds)
|
|
|
- {
|
|
|
- process = (current_second * 100) / total_seconds;
|
|
|
- device_status.process = process / 100.0;
|
|
|
- LOG_I("process:%d",process);
|
|
|
- HMI_WRITE("selfcheck.s106.val=%d",process);
|
|
|
- rt_thread_delay(1000);
|
|
|
- current_second++;
|
|
|
- if(device_status.selfcheck_ws==0)
|
|
|
- {
|
|
|
- HMI_WRITE("selfcheck.s106.val=100");
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- HMI_WRITE("selfcheck.s106.val=100");
|
|
|
- }else {
|
|
|
- process = 0;
|
|
|
- current_second = 0;
|
|
|
- if(device_status.rain_status==0)
|
|
|
- {
|
|
|
- rt_pin_mode(LED_P, PIN_MODE_OUTPUT);
|
|
|
- rt_pin_write(LED_P,ON);
|
|
|
- }
|
|
|
- //根据故障码 亮指示灯
|
|
|
- //灯管故障
|
|
|
- if(device_status.C01 & (1 << 0))
|
|
|
- {
|
|
|
- LOG_E("灯管故障!");
|
|
|
- //发送红灯常亮信号
|
|
|
- write_single_holding_register(0x01,0x00C2,0x0011,1000);
|
|
|
- //延时10S
|
|
|
- rt_thread_delay(10000);
|
|
|
- }
|
|
|
-
|
|
|
- //加热故障
|
|
|
- if(device_status.C01 & (1 << 1))
|
|
|
- {
|
|
|
- LOG_E("加热故障!");
|
|
|
- //发送红灯慢闪信号
|
|
|
- write_single_holding_register(0x01,0x00C2,0x0021,1000);
|
|
|
- //延时10S
|
|
|
- rt_thread_delay(10000);
|
|
|
- }
|
|
|
-
|
|
|
- //相机拍照故障
|
|
|
- if(device_status.C01 & (1 << 2))
|
|
|
- {
|
|
|
- LOG_E("拍照故障!");
|
|
|
- //发送红灯快闪信号
|
|
|
- write_single_holding_register(0x01,0x00C2,0x0031,1000);
|
|
|
- //延时10S
|
|
|
- rt_thread_delay(10000);
|
|
|
-
|
|
|
- }
|
|
|
- //补光灯故障
|
|
|
- if(device_status.C01 & (1 << 3))
|
|
|
- {
|
|
|
- LOG_E("补光灯故障!");
|
|
|
- //发送绿灯慢闪信号
|
|
|
- write_single_holding_register(0x01,0x00C2,0x0023,1000);
|
|
|
- //延时10S
|
|
|
- rt_thread_delay(10000);
|
|
|
- }
|
|
|
- //上仓门故障
|
|
|
- if(device_status.C01 & (1 << 8))
|
|
|
- {
|
|
|
- LOG_E("上仓门故障!");
|
|
|
- //发送黄灯常亮信号
|
|
|
- write_single_holding_register(0x01,0x00C2,0x0012,1000);
|
|
|
- //延时10S
|
|
|
- rt_thread_delay(10000);
|
|
|
- }
|
|
|
- //下仓门故障
|
|
|
- if(device_status.C01 & (1 << 9))
|
|
|
- {
|
|
|
- LOG_E("下仓门故障!");
|
|
|
- //发送黄灯慢闪信号
|
|
|
- write_single_holding_register(0x01,0x00C2,0x0022,1000);
|
|
|
- //延时10S
|
|
|
- rt_thread_delay(10000);
|
|
|
- }
|
|
|
- //清扫故障
|
|
|
- if(device_status.C01 & (1 << 10))
|
|
|
- {
|
|
|
- LOG_E("清扫故障!");
|
|
|
- //发送黄灯爆闪信号
|
|
|
- write_single_holding_register(0x01,0x00C2,0x0032,1000);
|
|
|
- //延时10S
|
|
|
- rt_thread_delay(10000);
|
|
|
- }
|
|
|
-
|
|
|
- //通信故障
|
|
|
- if(device_status.C01 & (1 << 13))
|
|
|
- {
|
|
|
- LOG_E("通信故障!");
|
|
|
- //发送绿灯爆闪信号
|
|
|
- write_single_holding_register(0x01,0x00C2,0x0033,1000);
|
|
|
- //延时10S
|
|
|
- rt_thread_delay(10000);
|
|
|
-
|
|
|
- }
|
|
|
- if(device_status.C01==0)
|
|
|
+ process = (current_second * 100) / total_seconds;
|
|
|
+ device_status.process = process / 100.0;
|
|
|
+ LOG_I("process:%d",process);
|
|
|
+ HMI_WRITE("selfcheck.s106.val=%d",process);
|
|
|
+ rt_thread_delay(1000);
|
|
|
+ current_second++;
|
|
|
+ if(device_status.selfcheck_ws==0)
|
|
|
{
|
|
|
- LOG_W("无故障!");
|
|
|
- //发送绿灯常亮信号
|
|
|
- write_single_holding_register(0x01,0x00C2,0x0013,1000);
|
|
|
- //延时10S
|
|
|
- rt_thread_delay(10000);
|
|
|
+ HMI_WRITE("selfcheck.s106.val=100");
|
|
|
+ break;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
+ HMI_WRITE("selfcheck.s106.val=100");
|
|
|
+ }else {
|
|
|
+ process = 0;
|
|
|
+ current_second = 0;
|
|
|
}
|
|
|
rt_thread_delay(1000);
|
|
|
}
|
|
|
@@ -1786,7 +1691,7 @@ static void t_shibie_callback(void *parameter)
|
|
|
int rt_software_timer_init(void)
|
|
|
{
|
|
|
//启动拍照超时定时器
|
|
|
- timer_shibie = rt_timer_create("t_shibie",t_shibie_callback,RT_NULL, 50000, RT_TIMER_FLAG_ONE_SHOT|RT_TIMER_FLAG_HARD_TIMER);
|
|
|
+ timer_shibie = rt_timer_create("t_shibie",t_shibie_callback,RT_NULL, 5000, RT_TIMER_FLAG_ONE_SHOT|RT_TIMER_FLAG_HARD_TIMER);
|
|
|
if(timer_takephoto==RT_NULL)
|
|
|
{
|
|
|
LOG_E("rt_timer_create t_shibie failed!");
|