Explorar el Código

优化雨控和4.0测试拍照故障

zhunk hace 1 año
padre
commit
8c867bba72

+ 1 - 1
Application_CBD/applications/control.c

@@ -1712,7 +1712,7 @@ void ResetInit(void)
             ctr_Fan_PUT(OFF);
             ctr_Fan_PUT(OFF);
             ctr_Fan_IN(OFF);
             ctr_Fan_IN(OFF);
             #endif
             #endif
-           if(device_status.version_type==4||device_status.version_type==41)
+           if(device_status.version_type==4||device_status.version_type==41||device_status.version_type==42||device_status.version_type==12)
            {
            {
                device_status.clear_status=1;
                device_status.clear_status=1;
                while(device_status.clear_status==1){
                while(device_status.clear_status==1){

+ 1 - 1
Application_CBD/applications/dtu_uart2.c

@@ -12,7 +12,7 @@
 #include <board.h>
 #include <board.h>
 #include <rtdevice.h>
 #include <rtdevice.h>
 #include  "stdarg.h"
 #include  "stdarg.h"
-#include  "string.h"version_type
+#include  "string.h"
 #include "stdio.h"
 #include "stdio.h"
 #include "dtu_uart2.h"
 #include "dtu_uart2.h"
 #include <cJSON.h>
 #include <cJSON.h>

+ 15 - 15
Application_CBD/applications/hmi.c

@@ -563,7 +563,7 @@ static void HMI_Decode(void)
     //清扫
     //清扫
     else if (strstr(rx_buffer,"clear")!=NULL) {
     else if (strstr(rx_buffer,"clear")!=NULL) {
         rt_kprintf("\n清扫!\n");
         rt_kprintf("\n清扫!\n");
-        if(device_status.version_type==4||device_status.version_type==41)
+        if(device_status.version_type==4||device_status.version_type==41||device_status.version_type==42)
         {
         {
             device_status.clear_status=1;
             device_status.clear_status=1;
         }
         }
@@ -1223,14 +1223,14 @@ static void HMI_Decode(void)
 
 
         }
         }
     }
     }
-    //高空
-    else if (strstr(rx_buffer,"SwversionV11")!=NULL)
+    //1.0
+    else if (strstr(rx_buffer,"SwversionV1")!=NULL)
     {
     {
-        device_status.dtype = 3;
-        if(device_status.version_type != 11)
+        if(device_status.version_type != 1)
         {
         {
-            device_status.version_type = 11;
-            sprintf(device_status.driver, "%s",VERSION_GK);
+            device_status.dtype = 3;
+            device_status.version_type = 1;
+            sprintf(device_status.driver, "%s",VERSION_ZP);
             ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
             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));        //版本类型
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型
             MA_save();
             MA_save();
@@ -1239,14 +1239,14 @@ static void HMI_Decode(void)
 
 
         }
         }
     }
     }
-    //1.0
-    else if (strstr(rx_buffer,"SwversionV1")!=NULL)
+    //高空
+    else if (strstr(rx_buffer,"SwversionV11")!=NULL)
     {
     {
-        if(device_status.version_type != 1)
+        device_status.dtype = 3;
+        if(device_status.version_type != 11)
         {
         {
-            device_status.dtype = 3;
-            device_status.version_type = 1;
-            sprintf(device_status.driver, "%s",VERSION_ZP);
+            device_status.version_type = 11;
+            sprintf(device_status.driver, "%s",VERSION_GK);
             ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));        //版本类型
             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));        //版本类型
             ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype));        //版本类型
             MA_save();
             MA_save();
@@ -1255,6 +1255,7 @@ static void HMI_Decode(void)
 
 
         }
         }
     }
     }
+
     //低端款
     //低端款
     else if (strstr(rx_buffer,"SwversionV42")!=NULL) {
     else if (strstr(rx_buffer,"SwversionV42")!=NULL) {
         device_status.dtype = 3;
         device_status.dtype = 3;
@@ -1618,7 +1619,7 @@ static void Ctr_Mortor_entry(void* parameter)
             if(photo_led_sec==900)
             if(photo_led_sec==900)
                 ctr_led(ON);
                 ctr_led(ON);
             //打开补光灯
             //打开补光灯
-            if((device_status.version_type==4||device_status.version_type==42)&&photo_led_sec==800)
+            if(photo_led_sec==800)
             {
             {
                 LOG_I("测试拍照!");
                 LOG_I("测试拍照!");
                 #if 1
                 #if 1
@@ -1627,7 +1628,6 @@ static void Ctr_Mortor_entry(void* parameter)
                 rt_free(takephotojson);
                 rt_free(takephotojson);
                 #endif
                 #endif
                 rt_thread_delay(5000);  //延时
                 rt_thread_delay(5000);  //延时
-
             }
             }
             //15S后执行拍照
             //15S后执行拍照
             else if (photo_led_sec==750)
             else if (photo_led_sec==750)

+ 8 - 6
Application_CBD/applications/sht30_collect.c

@@ -166,7 +166,7 @@ static void sht30_collect_thread_entry(void *parameter)
             sht3x_device = sht3x_init("i2c1", 0x44);
             sht3x_device = sht3x_init("i2c1", 0x44);
             rt_thread_mdelay(150);
             rt_thread_mdelay(150);
         }
         }
-        if(Read_Light_Voltage()>500)
+        if(Read_Light_Voltage()>500||atoi(device_status.lux)>500)
         {
         {
             checklightnum++;
             checklightnum++;
             if(checklightnum==20)
             if(checklightnum==20)
@@ -174,10 +174,12 @@ static void sht30_collect_thread_entry(void *parameter)
                 device_status.sun_status = 1;
                 device_status.sun_status = 1;
                 checklightnum =0;
                 checklightnum =0;
             }
             }
-
         }
         }
         else {
         else {
-            checknightnum ++;
+            if(atoi(device_status.lux)<500)
+            {
+                checknightnum ++;
+            }
             if(checknightnum==20)
             if(checknightnum==20)
             {
             {
                 device_status.sun_status = 0;
                 device_status.sun_status = 0;
@@ -285,7 +287,7 @@ static void Power_ReadCheck(void *parameter)
                 }
                 }
             }
             }
             //雨控
             //雨控
-            if(Read_Rain_Voltage()>1500&&device_status.selfcheck_ws==0)
+            if(Read_Rain_Voltage()>250&&device_status.selfcheck_ws==0)
             {
             {
                 device_status.rain_status = 1;
                 device_status.rain_status = 1;
                 ctr_lamp(OFF,1);
                 ctr_lamp(OFF,1);
@@ -296,13 +298,13 @@ static void Power_ReadCheck(void *parameter)
             else {
             else {
                 rain_cnt++;
                 rain_cnt++;
                 //雨控消抖,1分钟
                 //雨控消抖,1分钟
-                LOG_D("rain_cnt:%d-value:%d",rain_cnt,Read_Rain_Voltage());
-                if(rain_cnt==600&&Read_Rain_Voltage()<1500)
+                if(rain_cnt==600&&Read_Rain_Voltage()<250)
                 {
                 {
                     rain_cnt = 0;
                     rain_cnt = 0;
                     device_status.rain_status = 0;
                     device_status.rain_status = 0;
                 }
                 }
             }
             }
+            LOG_D("rain_cnt:%d-value:%d",rain_cnt,Read_Rain_Voltage());
         }
         }
         if(bat_cnt>=15){  //持续10s
         if(bat_cnt>=15){  //持续10s
             bat_cnt = 0;
             bat_cnt = 0;

+ 4 - 0
Application_CBD/readme.md

@@ -1,3 +1,7 @@
+# 2024-12-21 更新说明
+1. 雨控优化:监测阈值1500修改为250
+# 2024-12-20 更新说明
+1. 修复低端款测报灯测试清扫不起作用问题,原因version_type未适配
 # 2024-12-04 更新说明
 # 2024-12-04 更新说明
 #define VERSION_HK          "1.55.41(HK)"            //4.0海康-1200W
 #define VERSION_HK          "1.55.41(HK)"            //4.0海康-1200W
 #define VERSION_HK_2000W    "1.54.40(2000W)"         //4.0水稻/低端款
 #define VERSION_HK_2000W    "1.54.40(2000W)"         //4.0水稻/低端款