zhunk 1 rok temu
rodzic
commit
d842eb8995

+ 7 - 2
Application_CBD/applications/dtu_uart2.c

@@ -383,13 +383,18 @@ int dtu_data_play(void)
             DTU_THREAD_PRIORITY,
             DTU_THREAD_PRIORITY,
             DTU_THREAD_TIMESLICE);
             DTU_THREAD_TIMESLICE);
     /* 如果获得线程控制块,启动这个线程 */
     /* 如果获得线程控制块,启动这个线程 */
-    if(dtu_send_data!=RT_NULL)
-        rt_thread_startup(dtu_send_data);
+//    if(dtu_send_data!=RT_NULL)
+//        rt_thread_startup(dtu_send_data);
     /* 如果获得线程控制块,启动这个线程 */
     /* 如果获得线程控制块,启动这个线程 */
     if (dtu_recv_data != RT_NULL)
     if (dtu_recv_data != RT_NULL)
         rt_thread_startup(dtu_recv_data);
         rt_thread_startup(dtu_recv_data);
     return RT_EOK;
     return RT_EOK;
 }
 }
+void dtu_send_data_start(void)
+{
+    if(dtu_send_data!=RT_NULL)
+        rt_thread_startup(dtu_send_data);
+}
 
 
 char * makeJson_ReadInfo()
 char * makeJson_ReadInfo()
 {
 {

+ 3 - 0
Application_CBD/applications/dtu_uart2.h

@@ -16,6 +16,9 @@ typedef struct{
     char msg_pool[MAX_DTU_SIZE];
     char msg_pool[MAX_DTU_SIZE];
 }DataTemp;
 }DataTemp;
 
 
+
+void dtu_send_data_start(void);
+
 //查询数据---{"cmd": "read"}
 //查询数据---{"cmd": "read"}
 //重启-------{"cmd": "reboot"}
 //重启-------{"cmd": "reboot"}
 //升级-------{"cmd": "update"}
 //升级-------{"cmd": "update"}

+ 7 - 0
Application_CBD/applications/hmi.c

@@ -1249,6 +1249,7 @@ static void HMI_Decode(void)
         else {
         else {
 
 
         }
         }
+        return;
     }
     }
     //1.0
     //1.0
     else if (strstr(rx_buffer,"SwversionV1")!=NULL)
     else if (strstr(rx_buffer,"SwversionV1")!=NULL)
@@ -1265,6 +1266,7 @@ static void HMI_Decode(void)
         else {
         else {
 
 
         }
         }
+        return;
     }
     }
     //中端款
     //中端款
     else if (strstr(rx_buffer,"SwversionV43")!=NULL) {
     else if (strstr(rx_buffer,"SwversionV43")!=NULL) {
@@ -1278,6 +1280,7 @@ static void HMI_Decode(void)
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型+
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型+
             MA_save();
             MA_save();
         }
         }
+        return;
     }
     }
     //低端款
     //低端款
     else if (strstr(rx_buffer,"SwversionV42")!=NULL) {
     else if (strstr(rx_buffer,"SwversionV42")!=NULL) {
@@ -1291,6 +1294,7 @@ static void HMI_Decode(void)
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型+
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型+
             MA_save();
             MA_save();
         }
         }
+        return;
     }
     }
     //4.0
     //4.0
     else if (strstr(rx_buffer,"SwversionV41")!=NULL) {
     else if (strstr(rx_buffer,"SwversionV41")!=NULL) {
@@ -1308,6 +1312,7 @@ static void HMI_Decode(void)
         else {
         else {
 
 
         }
         }
+        return;
     }
     }
     //水稻
     //水稻
     else if (strstr(rx_buffer,"SwversionV4")!=NULL) {
     else if (strstr(rx_buffer,"SwversionV4")!=NULL) {
@@ -1324,6 +1329,7 @@ static void HMI_Decode(void)
         else {
         else {
 
 
         }
         }
+        return;
     }
     }
     //吸虫塔
     //吸虫塔
     else if (strstr(rx_buffer,"SwversionV6")!=NULL) {
     else if (strstr(rx_buffer,"SwversionV6")!=NULL) {
@@ -2159,6 +2165,7 @@ void Check_ParamConfig(void)
         if(device_status.version_type==6) device_status.timeSwitch = 1;
         if(device_status.version_type==6) device_status.timeSwitch = 1;
         DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
         DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
         rt_thread_delay(1000);
         rt_thread_delay(1000);
+        dtu_send_data_start();
 #endif
 #endif
     }
     }
 }
 }