yf_zjb 2 年 前
親
コミット
f3c5173253

BIN
Application_CBD/Debug/Application_CBD.bin


BIN
Application_CBD/Debug/Application_CBD.elf


ファイルの差分が大きいため隠しています
+ 1096 - 1098
Application_CBD/Debug/Application_CBD.map


BIN
Application_CBD/Debug/applications/beep.o


BIN
Application_CBD/Debug/applications/control.o


BIN
Application_CBD/Debug/applications/dtu_uart2.o


BIN
Application_CBD/Debug/applications/hmi.o


BIN
Application_CBD/Debug/applications/main.o


BIN
Application_CBD/Debug/applications/sample_mb_master.o


BIN
Application_CBD/Debug/applications/sht30_collect.o


+ 14 - 10
Application_CBD/applications/control.c

@@ -1679,7 +1679,7 @@ void ResetInit(void)
                LOG_W("异常退出!!!\n");
                LOG_W("异常退出!!!\n");
                return;
                return;
            }
            }
-            #if LAMP_EN == 0
+            #if 0//LAMP_EN == 0
             ctr_Fan_PUT(OFF);
             ctr_Fan_PUT(OFF);
             ctr_Fan_IN(OFF);
             ctr_Fan_IN(OFF);
             #endif
             #endif
@@ -1687,7 +1687,11 @@ void ResetInit(void)
            {
            {
                device_status.clear_status=1;
                device_status.clear_status=1;
            }
            }
-           rt_thread_delay(1000);
+           while(device_status.clear_status==1){
+               rt_thread_delay(1000);
+           }
+           //排虫
+           device_status.vol = 111;
     }
     }
     else {
     else {
         if(device_status.power_status==1)
         if(device_status.power_status==1)
@@ -2222,7 +2226,7 @@ void WorkTask(void)
                 rt_free(ctr_hk_p_warn);
                 rt_free(ctr_hk_p_warn);
             }
             }
             #endif
             #endif
-            #if LAMP_EN == 0
+            #if 0//LAMP_EN == 0
             ctr_Fan_PUT(ON);
             ctr_Fan_PUT(ON);
             #endif
             #endif
             DTU_Write("workstart.mp3");
             DTU_Write("workstart.mp3");
@@ -2276,12 +2280,12 @@ void WorkTask(void)
 
 
             while(clt_time!=1)
             while(clt_time!=1)
             {
             {
-                #if LAMP_EN == 0
+                #if 0//LAMP_EN == 0
                     ctr_Fan_IN(ON);
                     ctr_Fan_IN(ON);
                 #endif
                 #endif
                 clt_time --;
                 clt_time --;
                 rt_thread_delay(1000);
                 rt_thread_delay(1000);
-                #if LAMP_EN == 0
+                #if 0//LAMP_EN == 0
                     if(clt_time%30==0)
                     if(clt_time%30==0)
                     ctr_Fan_PUT(OFF);
                     ctr_Fan_PUT(OFF);
                 #endif
                 #endif
@@ -2295,7 +2299,7 @@ void WorkTask(void)
                     ctr_lamp(OFF,2);
                     ctr_lamp(OFF,2);
                     ctr_lamp(OFF,3);
                     ctr_lamp(OFF,3);
                     #endif
                     #endif
-                    #if LAMP_EN == 0
+                    #if 0//LAMP_EN == 0
                     ctr_Fan_IN(OFF);
                     ctr_Fan_IN(OFF);
                     #endif
                     #endif
                     rt_kprintf("异常退出!!!\n");
                     rt_kprintf("异常退出!!!\n");
@@ -2309,7 +2313,7 @@ void WorkTask(void)
                     ctr_lamp(OFF,2);
                     ctr_lamp(OFF,2);
                     ctr_lamp(OFF,3);
                     ctr_lamp(OFF,3);
                     #endif
                     #endif
-                    #if LAMP_EN == 0
+                    #if 0//LAMP_EN == 0
                     ctr_Fan_IN(OFF);
                     ctr_Fan_IN(OFF);
                     #endif
                     #endif
                     rt_kprintf("异常退出!!!\n");
                     rt_kprintf("异常退出!!!\n");
@@ -2325,7 +2329,7 @@ void WorkTask(void)
                 ctr_lamp(OFF,2);
                 ctr_lamp(OFF,2);
                 ctr_lamp(OFF,3);
                 ctr_lamp(OFF,3);
                 #endif
                 #endif
-                #if LAMP_EN == 0
+                #if 0//LAMP_EN == 0
                 ctr_Fan_IN(OFF);
                 ctr_Fan_IN(OFF);
                 #endif
                 #endif
                 rt_kprintf("异常退出!!!\n");
                 rt_kprintf("异常退出!!!\n");
@@ -2339,14 +2343,14 @@ void WorkTask(void)
                 ctr_lamp(OFF,2);
                 ctr_lamp(OFF,2);
                 ctr_lamp(OFF,3);
                 ctr_lamp(OFF,3);
                 #endif
                 #endif
-                #if LAMP_EN == 0
+                #if 0//LAMP_EN == 0
                 ctr_Fan_IN(OFF);
                 ctr_Fan_IN(OFF);
                 #endif
                 #endif
                 rt_kprintf("异常退出!!!\n");
                 rt_kprintf("异常退出!!!\n");
                 HMI_WRITE("workSta.g0.txt=\"异常退出\"");
                 HMI_WRITE("workSta.g0.txt=\"异常退出\"");
                 break;
                 break;
             }
             }
-            #if LAMP_EN == 0
+            #if 0//LAMP_EN == 0
             ctr_Fan_IN(OFF);
             ctr_Fan_IN(OFF);
             #endif
             #endif
             //4.关闭上仓门
             //4.关闭上仓门

+ 2 - 2
Application_CBD/applications/control.h

@@ -19,7 +19,7 @@
 #define ROBOT_EN         0              //机器人
 #define ROBOT_EN         0              //机器人
 #define Color_EN         0              //定制色诱
 #define Color_EN         0              //定制色诱
 #define BZYV2_EN         0              //孢子仪2.0
 #define BZYV2_EN         0              //孢子仪2.0
-#define BOOT_ERR         0              //1-新bootloader,0-旧bootloader()2023年9月份之前的设备升级需要设置为0
+#define BOOT_ERR         1              //1-新bootloader,0-旧bootloader()2023年9月份之前的设备升级需要设置为0
 ////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////
 #if LAMP_EN == 1
 #if LAMP_EN == 1
     #define VERSION_HK          "1.(3ledv7).41(HK)" //4.0海康-三色光源
     #define VERSION_HK          "1.(3ledv7).41(HK)" //4.0海康-三色光源
@@ -27,7 +27,7 @@
     #define VERSION_HK          "1.51.41(HK)"       //4.0海康-1200W
     #define VERSION_HK          "1.51.41(HK)"       //4.0海康-1200W
 #endif
 #endif
 #define VERSION_HK_4800W    ""                      //4.0海康-4800W
 #define VERSION_HK_4800W    ""                      //4.0海康-4800W
-#define VERSION_HK_2000W    "1.48.4(2000W)"         //4.0水稻
+#define VERSION_HK_2000W    "1.48.40(2000W)"         //4.0水稻
 #define VERSION_ZP          "1.44.1(ZP)"            //1.0转盘
 #define VERSION_ZP          "1.44.1(ZP)"            //1.0转盘
 #define VERSION_GK          "1.40.1(GK)"            //1.0高空
 #define VERSION_GK          "1.40.1(GK)"            //1.0高空
 #define VERSION_XCT         "1.13.6(HK)"            //吸虫塔-海康
 #define VERSION_XCT         "1.13.6(HK)"            //吸虫塔-海康

+ 7 - 1
Application_CBD/applications/dtu_uart2.c

@@ -876,7 +876,13 @@ int parseDtu(char *json_string)
                       DTU_Write("黄板复位:%d",ctr_Color_board(RESET, 800));
                       DTU_Write("黄板复位:%d",ctr_Color_board(RESET, 800));
                       #endif
                       #endif
                   }
                   }
-
+                  //{"ext": {"type": "paichong"}, "cmd": "ctrl"}   排虫
+                  else if (strstr(type->valuestring,"paichong")!=RT_NULL) {
+                      char *turn_zp = makeJson_Warn("send cmd success:paichong","control");
+                      DTU_Write("%s",turn_zp);
+                      rt_free(turn_zp);
+                      device_status.vol = 111;
+                  }
               }
               }
               //切换平台
               //切换平台
               else if (strstr(item_cmd->valuestring,"platform")!=RT_NULL)
               else if (strstr(item_cmd->valuestring,"platform")!=RT_NULL)

+ 41 - 1
Application_CBD/applications/hmi.c

@@ -647,6 +647,11 @@ static void HMI_Decode(void)
         }
         }
 
 
     }
     }
+    //排虫
+    else if(strstr(rx_buffer,"putTest.paichong")!=NULL){
+        device_status.vol = 111;
+        LOG_I("开始排虫!");
+    }
     //定时设置
     //定时设置
     else if (strstr(rx_buffer,"saveClockSet=")!=NULL) {
     else if (strstr(rx_buffer,"saveClockSet=")!=NULL) {
         char value_str[10];
         char value_str[10];
@@ -1261,7 +1266,8 @@ static void Ctr_Mortor_entry(void* parameter)
    rt_uint16_t num_down_open = 200;  //
    rt_uint16_t num_down_open = 200;  //
    rt_uint16_t num_down_close = 200;  //
    rt_uint16_t num_down_close = 200;  //
    rt_int16_t photo_led_sec = 900;  //55S
    rt_int16_t photo_led_sec = 900;  //55S
-
+   rt_uint8_t num_tg_open = 200;    //20S
+   rt_uint8_t num_tg_init = 200;
    //int current_t[200];
    //int current_t[200];
    /*孢子仪拍照数量*/
    /*孢子仪拍照数量*/
    rt_uint16_t photo_setup = 0;
    rt_uint16_t photo_setup = 0;
@@ -1517,6 +1523,40 @@ static void Ctr_Mortor_entry(void* parameter)
         {
         {
             ctr_Petroleum_jelly(10);
             ctr_Petroleum_jelly(10);
         }
         }
+        if(device_status.vol==111){
+            ctr_Fan_IN(ON);   //推杆电机收缩(供电打开,复位)
+            num_tg_init--;
+            if(num_tg_init%10==0)
+                HMI_WRITE("sysTest.result.txt=\"排虫复位中:%d\"",num_tg_init/10);
+            if(num_tg_init==0){
+                HMI_WRITE("sysTest.result.txt=\"排虫复位完成\"");
+                ctr_Fan_PUT(ON);
+                num_tg_init = 200;
+                device_status.vol=112;
+            }
+        }else if(device_status.vol==112){
+            num_tg_open--;
+            if(num_tg_open%10==0)
+                            HMI_WRITE("sysTest.result.txt=\"开始执行排虫:%d\"",num_tg_open/10);
+            if(num_tg_open==0){
+                HMI_WRITE("sysTest.result.txt=\"排虫复位中\"");
+                ctr_Fan_PUT(OFF);
+                num_tg_open = 200;
+                device_status.vol=113;
+            }
+        }else if(device_status.vol==113){
+            num_tg_init--;
+            if(num_tg_init%10==0)
+                            HMI_WRITE("sysTest.result.txt=\"排虫复位中:%d\"",num_tg_init/10);
+            if(num_tg_init==0){
+                HMI_WRITE("sysTest.result.txt=\"排虫机执行已完成!\"");
+                ctr_Fan_PUT(OFF);
+                ctr_Fan_IN(OFF);
+                num_tg_init = 200;
+                device_status.vol=0;
+            }
+        }
+
         //一键测试
         //一键测试
         if(device_status.auto_test_sw==1)
         if(device_status.auto_test_sw==1)
         {
         {