Przeglądaj źródła

2.42.000(2000W)

zhunk 4 miesięcy temu
rodzic
commit
8d4f1198b7

+ 1 - 1
Application_CBD/.settings/language.settings.xml

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1271424796576257041" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1260761146960173824" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>

+ 1 - 1
Application_cbd_apm32f1/.settings/language.settings.xml

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-495673559781908112" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-406456977695124745" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>

+ 27 - 3
Application_cbd_apm32f1/applications/control.c

@@ -1026,17 +1026,41 @@ uint8_t ctr_clear(uint16_t status_clear)
 
 
 //路由器供电
+static rt_timer_t timer_router = RT_NULL;
+
+static void router_timeout_callback(void *parameter)
+{
+    LOG_W("路由器定时恢复供电");
+    ctr_router(ON);
+}
+
 void ctr_router(uint8_t status_router)
 {
     rt_pin_mode(ROUTER, PIN_MODE_OUTPUT);
 
-    //rt_pin_mode(POWER_CLEAR, PIN_MODE_OUTPUT);
     if(status_router==ON)
     {
+        /* 关闭可能存在的定时器 */
+        if (timer_router != RT_NULL) {
+            rt_timer_stop(timer_router);
+        }
         rt_pin_write(ROUTER,ON);
     }
     else {
         rt_pin_write(ROUTER,OFF);
+        /* 创建单次定时器(30分钟),超时后自动恢复供电 */
+        if (timer_router == RT_NULL) {
+            timer_router = rt_timer_create("t_router", router_timeout_callback,
+                                           RT_NULL, 60 * 60 * RT_TICK_PER_SECOND,
+                                           RT_TIMER_FLAG_ONE_SHOT | RT_TIMER_FLAG_HARD_TIMER);
+            if (timer_router == RT_NULL) {
+                LOG_E("timer_router create failed!");
+                return;
+            }
+        } else {
+            rt_timer_stop(timer_router);
+        }
+        rt_timer_start(timer_router);
     }
 }
 //清扫-推杆电机
@@ -2042,13 +2066,13 @@ static void Work_Loop_thread_entry(void *parameter)
                     Uart5_Write_Bin(motor1_Forword, sizeof(motor1_Forword));   //推杆打开
                     rt_thread_delay(20000);
                     Uart5_Write_Bin(motor2_Forword, sizeof(motor2_Forword));   //震动
-                    ctr_Collect_Fan(ON)
+                    ctr_Collect_Fan(ON);
                     for(uint8_t i = 0; i < 30; i++){
                         rt_thread_delay(1000);
                         LOG_I("等待震动完成:%d",i);
                     }
                     Uart5_Write_Bin(motor2_Stop, sizeof(motor2_Stop));   //关闭震动
-                    ctr_Collect_Fan(OFF)
+                    ctr_Collect_Fan(OFF);
                     rt_thread_delay(2000);
                     Uart5_Write_Bin(motor1_Backward, sizeof(motor1_Backward));   //推杆关闭
                     rt_thread_delay(1000);

+ 1 - 1
Application_cbd_apm32f1/applications/control.h

@@ -41,7 +41,7 @@
 #else
     #define VERSION_HK          "2.40.41(HK)"            //4.0海康-1200W
     #if TG_MODULE == 0
-    #define VERSION_HK_2000W    "2.40.000(2000W)"         //4.0水稻
+    #define VERSION_HK_2000W    "2.42.000(2000W)"         //4.0水稻
     #else
     #if MATCH_DEVICE == 1
     #define VERSION_HK_2000W    "3.3.4(TG)"             //推杆结构比赛设备

+ 2 - 0
Application_cbd_apm32f1/applications/dtu_uart2.c

@@ -1887,10 +1887,12 @@ int parseDtu(char *json_string)
                                   device_status.work_mode = 0;
                                   ef_set_env_blob("work_mode", &device_status.work_mode, sizeof(device_status.work_mode));
                                   LOG_W("修改工作模式:%d",device_status.work_mode);
+                                  ctr_router(OFF);
                               }else if(strcmp(mode->valuestring,"B")==0){
                                   device_status.work_mode = 1;
                                   ef_set_env_blob("work_mode", &device_status.work_mode, sizeof(device_status.work_mode));
                                   LOG_W("修改工作模式:%d",device_status.work_mode);
+                                  ctr_router(ON);
                               }
                               static char temp[10];
                               rt_sprintf(temp, "mode:%d",device_status.work_mode);

+ 16 - 0
Application_cbd_apm32f1/applications/hmi.c

@@ -1526,6 +1526,13 @@ static void HMI_Decode(void)
         device_status.work_mode = !device_status.work_mode;
         ef_set_env_blob("work_mode", &device_status.work_mode, sizeof(device_status.work_mode));
         LOG_W("修改工作模式:%d",device_status.work_mode);
+#if MATCH_DEVICE == 1
+        if(device_status.work_mode == 0){
+            ctr_router(OFF);
+        }else{
+            ctr_router(ON);
+        }
+#endif
     }else if(strstr(rx_buffer,"DeleteUimage")!=NULL){
         char* temp = makeJsonRpc2_0("upan_delete_image", NULL, 1);
         if(temp){
@@ -2011,6 +2018,7 @@ void Check_ParamConfig(void)
         LOG_I("handle_bugger:%d",device_status.handle_bugger);
         LOG_I("alarm_tg:%s",device_status.alarm_tg);
         LOG_I("motor_active:%d",device_status.motor_active);
+        LOG_I("work_mode:%d",device_status.work_mode);
     }
     //RTC时间判断,如果当前年份小于2020,提示需要设置时间,切换为光控
     if(device_status.update_flag==1)
@@ -2026,7 +2034,15 @@ void Check_ParamConfig(void)
         rt_sprintf(device_status.csq,"0");
         rt_sprintf(device_status.sim,"1");
         Sys_Motor_Task();
+#if MATCH_DEVICE == 1
+        if(device_status.work_mode==0){
+            ctr_router(OFF);
+        }else{
+            ctr_router(ON);
+        }
+#else
         ctr_router(ON);
+#endif
         Hmi_Fresh();
         Control_clear();
         Control_Check();    //自检

+ 1 - 1
Application_cbd_apm32f1/packages/EasyFlash-v4.1.0/inc/ef_cfg.h

@@ -92,7 +92,7 @@
 #define EF_START_ADDR             PKG_EASYFLASH_START_ADDR
 
 /* ENV area size. It's at least one empty sector for GC. So it's definition must more then or equal 2 flash sector size. */
-#define ENV_AREA_SIZE             (EF_ERASE_MIN_SIZE * 16) /* default is the double erase min size */
+#define ENV_AREA_SIZE             (EF_ERASE_MIN_SIZE * 256) /* default is the double erase min size */
 
 /* print debug information of flash */
 #ifdef PKG_EASYFLASH_DEBUG

+ 6 - 0
Application_cbd_apm32f1/readme.md

@@ -1,3 +1,9 @@
+# 2026-07-12 更新说明
+	#define VERSION_HK_2000W    "2.42.000(2000W)"         //4.0水稻
+	1、增大env分区大小,解决丢参数问题;
+	2、启动后检查模式,如果为A模式,关闭路由器电源,60分钟后恢复;
+	3、切换A模式,立即关闭路由器电源,60分钟后恢复;
+	4、切换B模式后立即打开路由器电源;
 # 2026-06-24 更新说明
 	#define VERSION_HK_2000W    "2.12.4(TG111)"         //推杆结构
 	1、修复不是别赛设备发送串口数据串口异常导致死机;