zhunk 1 год назад
Родитель
Сommit
30dec100e7

+ 1 - 1
Application_cbd_apm32f1/.settings/projcfg.ini

@@ -1,5 +1,5 @@
 #RT-Thread Studio Project Configuration
-#Mon Apr 21 16:30:25 CST 2025
+#Thu May 15 12:00:59 CST 2025
 project_type=rtt
 chip_name=STM32F103RE
 cpu_name=None

+ 1 - 22
Application_cbd_apm32f1/applications/control.c

@@ -1982,22 +1982,6 @@ void WorkTask(void)
                 //ctr_shake(ON, 100);
             }
         }
-        else {
-                    //打开高压
-                    ctr_Heat(ON);
-                    //打开补光
-                    ctr_led(ON);
-                    LOG_I("打开补光!!");
-                    rt_pin_mode(CLEAR_L_LIMIT,PIN_MODE_INPUT);
-                    //2.翻转清虫
-                    while(rt_pin_read(CLEAR_L_LIMIT)==1)  rt_thread_delay(20);
-                    rt_thread_delay(500);
-                    Hk_Take_io();  //触发海康相机拍照
-                    rt_thread_delay(500);
-                    ctr_turnv5();  //摆动清虫
-                    LOG_I("摆动清虫!");
-
-        }
    }
     if(device_status.bat_status == 1 || device_status.temp_status == 1 || device_status.rain_status==1 || device_status.ds==0)
     {
@@ -2159,12 +2143,7 @@ static void Control_Clear_thread_entry(void *parameter)
     {
         if(device_status.clear_status==1)
         {
-            if(device_status.version_type==41){
-                ctr_TG_Clear(300);
-            }else {
-                ctr_TG_Clear(200);
-            }
-
+            ctr_TG_Clear(250);
         }
         rt_thread_delay(100);
     }

+ 2 - 1
Application_cbd_apm32f1/applications/control.h

@@ -16,7 +16,7 @@
 //定制相关//////////////////////////////////////////////////////
 #define LAMP_EN          0             //李新3灯管:0关闭,1打开
 #define PCB_V1           1
-#define SENSOR_EN        1              //温湿度:0关闭,1打开
+#define SENSOR_EN        0              //温湿度:0关闭,1打开
 ////////////////////////////////////////////////////////////////
 #if LAMP_EN == 1
     #define VERSION_HK          "1.(3ledV9).41(HK)"      //4.0海康-三色光源
@@ -24,6 +24,7 @@
 #else
     #define VERSION_HK          "2.4.41(HK)"            //4.0海康-1200W
     #define VERSION_HK_2000W    "2.11.4(2000W)"         //4.0水稻
+    #define VERSION_UVC         "1.0.3"                 //3.0
 #endif
 
 #define VERSION_ZP          "1.45.1(ZP)"            //1.0转盘

+ 5 - 4
Application_cbd_apm32f1/applications/dtu_uart2.c

@@ -260,8 +260,6 @@ void process_uart_data(const char *data, int length)
 }
 
 
-
-
 /* 入口函数-指令接收*/
 static void dtu_thread_entry_recv(void *parameter)
 {
@@ -289,7 +287,7 @@ static void dtu_thread_entry_recv(void *parameter)
                     ctr_RTU_DTU(OFF);
                 }
             }
-            if (rx_err==54100&&device_status.bat_status==0)
+            if (rx_err>54100&&device_status.bat_status==0)
             {
                 LOG_W("通信中断,RTU重新上电");
                 rx_err = 0;
@@ -512,7 +510,7 @@ static void dtu_thread_entry_send(void *parameter)
             wait_i ++;
             LOG_I("wait connect internet......%d",wait_i);
             //检测到电源掉电
-            if(atoi(device_status.voltage)<5&&device_status.power_status==1&&wait_i>200)
+            if(Read_Real_Voltage()/100<5&&device_status.power_status==1&&wait_i>200)
             {
                 check_i++;
                 LOG_W("断网状态下检测到设备断电!%d",atoi(device_status.voltage));
@@ -953,6 +951,9 @@ char * makeJson()
     {
         rt_sprintf(device_status.driver,"%s-%s",VERSION_ZP,device_status.driver_4g);
     }
+    else if (device_status.version_type==30) {
+        rt_sprintf(device_status.driver,"%s-%s",VERSION_UVC,device_status.driver_4g);
+    }
     else if (device_status.version_type==4) {
         rt_sprintf(device_status.driver,"%s-%s",VERSION_HK_2000W,device_status.driver_4g);
     }

+ 24 - 9
Application_cbd_apm32f1/applications/hmi.c

@@ -1106,6 +1106,24 @@ static void HMI_Decode(void)
     else if (strstr(rx_buffer,"DebugDisable")!=NULL) {
         Debug_log_OFF();
     }
+
+    //3.0测报灯
+    else if (strstr(rx_buffer,"SwversionV3.0")!=NULL)
+    {
+        device_status.dtype = 3;
+        if(device_status.version_type != 30)
+        {
+            device_status.version_type = 30;
+            sprintf(device_status.driver, "%s",VERSION_UVC);
+            ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
+            ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型
+            MA_save();
+        }
+        else {
+
+        }
+    }
+
     //高空
     else if (strstr(rx_buffer,"SwversionV11")!=NULL)
     {
@@ -1960,6 +1978,8 @@ void Check_ParamConfig(void)
         }
         else if (device_status.version_type==5) {
             rt_sprintf(device_status.driver, "%s",VERSION_V5);
+        }else if (device_status.version_type==30) {
+            rt_sprintf(device_status.driver, "%s",VERSION_UVC);
         }
         /*定制三色光源*/
         #if LAMP_EN == 1
@@ -2021,8 +2041,9 @@ void Check_ParamConfig(void)
         sht30_collect();
 #if SENSOR_EN==1
         mb_master_samlpe();
-#endif
         thread_485_play();
+#endif
+
 #if ROBOT_EN == 0
         uint16_t connect_num=0;
         //等待联网,
@@ -2065,18 +2086,12 @@ void Check_ParamConfig(void)
         if(device_status.version_type==6) device_status.timeSwitch = 1;
         DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
         rt_thread_delay(1000);
-        if(device_status.dtype!=7&&device_status.version_type!=30)
+        if(device_status.update_flag==0)
         {
             Workstatus_check();
-        }
-
-        /********************/
-        //工作流程
-        if(device_status.version_type!=30)
-        {
+            //工作流程
             Work_Loop_Task();
         }
-
 #endif
     }
 }