zhunk 6 ماه پیش
والد
کامیت
5d7826734b
3فایلهای تغییر یافته به همراه21 افزوده شده و 5 حذف شده
  1. 4 4
      Application_CBD/applications/control.c
  2. 1 1
      Application_CBD/applications/control.h
  3. 16 0
      Application_CBD/applications/main.c

+ 4 - 4
Application_CBD/applications/control.c

@@ -1783,9 +1783,9 @@ void ResetInit(void)
                    rt_thread_delay(1000);
                }
            }
-            #if DZ_260519 == 1
-            device_status.clear_status = 2;
-            #endif
+           #if DZ_260519 == 1
+           device_status.clear_status = 2;
+           #endif
            #if LAMP_EN == 0
            //排虫
            if(device_status.handle_bugger==0){
@@ -2641,7 +2641,7 @@ void WorkTask(void)
                 device_status.photo_ws = 1;
             }
 #if DZ_260519 == 1
-            if(workloop==3){
+            if(workloop==3&&device_status.clt_time==10&&device_status.heattime==10){
                   workloop = 0;
                   device_status.clear_status = 2;
             }

+ 1 - 1
Application_CBD/applications/control.h

@@ -21,7 +21,7 @@
 
 #define BOOT_ERR         1              //1-新bootloader,0-旧bootloader()2023年9月份之前的设备升级需要设置为0
 #define DZ_250723        0              //触发雨控后隔天再解除
-#define DZ_260519        0              //进入工作后,每小时转一次仓
+#define DZ_260519        1              //进入工作后,每小时转一次仓
 ////////////////////////////////////////////////////////////////
 #if LAMP_EN == 1
     #define VERSION_HK          "1.(3ledV9).41(HK)"      //4.0海康-三色光源

+ 16 - 0
Application_CBD/applications/main.c

@@ -124,6 +124,22 @@ static void idle_hook(void)
             device_status.clear_status=2 ;  //2024-03-21 :开机不再转仓
         }
     }
+#else
+    static time_t work_start = 0;
+    static uint8_t last_ws = 0;
+     if (device_status.work_status == 1 && last_ws == 0) {
+         work_start = now;               // 记录开始工作的时间
+     }
+     last_ws = device_status.work_status;
+     if (device_status.work_status == 1 &&
+         (device_status.clt_time != 10 || device_status.heattime != 10) &&
+         difftime(now, work_start) >= 3600)
+     {
+         work_start = now;               // 重置,开始下一小时计时
+         if (device_status.version_type == 1) {
+             device_status.clear_status = 2;
+         }
+     }
 #endif
     if((alarm_new.tm_hour)==8&&(alarm_new.tm_min==20)&&(alarm_new.tm_sec==0))
     {