zhunk 1 год назад
Родитель
Сommit
3c32f0349d
1 измененных файлов с 12 добавлено и 19 удалено
  1. 12 19
      Application_cbd_apm32f1/applications/dtu_uart2.c

+ 12 - 19
Application_cbd_apm32f1/applications/dtu_uart2.c

@@ -273,30 +273,23 @@ static void dtu_thread_entry_recv(void *parameter)
     {
         //
         // 从消息队列中获取被回调函数放入消息队列中的内容
-        int result = rt_mq_recv(&rx_mq_dtu, &msg, sizeof(struct rx_msg), 50);
+        int result = rt_mq_recv(&rx_mq_dtu, &msg, sizeof(struct rx_msg), 100);
         if (result != RT_EOK){
             rx_err ++;
             if(rx_err==15){
                 json_ctx.index = 0;
             }
-            if(rx_err==54000)//90分钟未接收到数据
-            {
-                if(device_status.version_type==6)
-                {
-                    LOG_E("RK3399 transter Error!");
-                    ctr_photo(OFF);
-                }
-                else {
-                    ctr_RTU_DTU(OFF);
-                }
-            }
-            if (rx_err>54100&&device_status.bat_status==0)
-            {
-                LOG_W("通信中断,RTU重新上电");
-                rx_err = 0;
-                ctr_RTU_DTU(ON);
-                ctr_photo(ON);
-            }
+//            if(rx_err==54000)//90分钟未接收到数据
+//            {
+//                ctr_RTU_DTU(OFF);
+//            }
+//            if (rx_err>54100&&device_status.bat_status==0)
+//            {
+//                LOG_W("通信中断,RTU重新上电");
+//                rx_err = 0;
+//                ctr_RTU_DTU(ON);
+//                ctr_photo(ON);
+//            }
             continue;
         }
         // 动态分配接收缓冲区