Browse Source

开启编译优化

yf_zjb 5 years ago
parent
commit
8eef31393a

+ 1 - 1
Application_CBD/.cproject

@@ -20,7 +20,7 @@
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" useByScannerDiscovery="false" value="true" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" useByScannerDiscovery="false" value="true" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.1365878149" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" useByScannerDiscovery="false"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.1365878149" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" useByScannerDiscovery="false"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.709136944" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" useByScannerDiscovery="false" value="true" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.709136944" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" useByScannerDiscovery="false" value="true" valueType="boolean"/>
-							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1986446770" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1986446770" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.more" valueType="enumerated"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1312975261" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" useByScannerDiscovery="true" value="false" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1312975261" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" useByScannerDiscovery="true" value="false" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.1538128212" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" useByScannerDiscovery="true" value="false" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.1538128212" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" useByScannerDiscovery="true" value="false" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.2136804218" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.2136804218" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" useByScannerDiscovery="true" value="true" valueType="boolean"/>

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

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<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.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" 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="-179263276658058601" 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="-164989539578436777" 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.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>
 			</provider>

+ 35 - 12
Application_CBD/applications/control.c

@@ -178,19 +178,44 @@ void turnzp(void)
     rt_pin_write(CLEAR_L,OFF);
     rt_pin_write(CLEAR_L,OFF);
     while(rt_pin_read(CLEAR_R_LIMIT)==0)
     while(rt_pin_read(CLEAR_R_LIMIT)==0)
     {
     {
-        rt_pin_write(CLEAR_R,ON);
-        rt_pin_write(CLEAR_L,OFF);
-        rt_thread_delay(10);
-        turn_timeout++;
-        if(turn_timeout==1000) break;
+
+        rt_thread_delay(20);
+        while(rt_pin_read(CLEAR_R_LIMIT)==0)
+        {
+            rt_pin_write(CLEAR_R,ON);
+            rt_pin_write(CLEAR_L,OFF);
+            rt_thread_delay(50);
+            turn_timeout++;
+            if(turn_timeout==1000) break;
+        }
+        break;
     }
     }
     while(rt_pin_read(CLEAR_R_LIMIT)==1)
     while(rt_pin_read(CLEAR_R_LIMIT)==1)
     {
     {
-        rt_pin_write(CLEAR_R,ON);
-        rt_pin_write(CLEAR_L,OFF);
-        rt_thread_delay(10);
-        turn_timeout++;
-        if(turn_timeout==1000) break;
+        rt_thread_delay(20);
+        while(rt_pin_read(CLEAR_R_LIMIT)==1)
+        {
+            rt_thread_delay(50);
+            rt_pin_write(CLEAR_R,ON);
+            rt_pin_write(CLEAR_L,OFF);
+            turn_timeout++;
+            if(turn_timeout==1000) break;
+        }
+        break;
+    }
+    while(rt_pin_read(CLEAR_R_LIMIT)==0)
+    {
+
+        rt_thread_delay(20);
+        if(rt_pin_read(CLEAR_R_LIMIT)==0)
+        {
+            rt_pin_write(CLEAR_R,OFF);
+            rt_pin_write(CLEAR_L,OFF);
+            break;
+        }
+        else {
+            break;
+        }
     }
     }
     rt_pin_write(CLEAR_R,OFF);
     rt_pin_write(CLEAR_R,OFF);
     rt_pin_write(CLEAR_L,OFF);
     rt_pin_write(CLEAR_L,OFF);
@@ -465,7 +490,6 @@ void HardWare_Init(uint8_t boot)
     //关闭上仓门
     //关闭上仓门
     ctr_cangmen_up(OFF);
     ctr_cangmen_up(OFF);
 
 
-
     if(boot==1)
     if(boot==1)
     {
     {
         HMI_WRITE("hardcheck.checktip.txt=\"上仓门电机已停止!!!\"");
         HMI_WRITE("hardcheck.checktip.txt=\"上仓门电机已停止!!!\"");
@@ -931,7 +955,6 @@ int Workstatus_check(void)
     }
     }
     return 0;
     return 0;
 }
 }
-
 /*工作流程线程*/
 /*工作流程线程*/
 int Work_Loop_Task(void)
 int Work_Loop_Task(void)
 {
 {

+ 3 - 3
Application_CBD/applications/control.h

@@ -13,10 +13,10 @@
 #include <board.h>
 #include <board.h>
 
 
 #include <rtdevice.h>
 #include <rtdevice.h>
-#define VERSION_HK "1.14.41(HK)"         //版本
-#define VERSION_ZP "1.14.1(ZP)"         //版本
+#define VERSION_HK "1.15.41(HK)"         //版本
+#define VERSION_ZP "1.15.1(ZP)"         //版本
 
 
-#define CompileTime "20210525"
+#define CompileTime "20210601"
 
 
 /*******************************测试任务****************************************/
 /*******************************测试任务****************************************/
 /*********************************************************************/
 /*********************************************************************/

+ 2 - 1
Application_CBD/packages/fal-latest/samples/porting/fal_flash_sfud_port.c

@@ -113,7 +113,8 @@ static int rt_hw_on_chip_flash_init(void)
     fal_init();
     fal_init();
     return RT_EOK;
     return RT_EOK;
 }
 }
-INIT_COMPONENT_EXPORT(rt_hw_on_chip_flash_init);
+//INIT_COMPONENT_EXPORT(rt_hw_on_chip_flash_init);
+INIT_ENV_EXPORT(rt_hw_on_chip_flash_init);
 #endif
 #endif
 
 
 #endif /* FAL_USING_SFUD_PORT */
 #endif /* FAL_USING_SFUD_PORT */

+ 5 - 2
Application_CBD/readme.md

@@ -115,8 +115,11 @@ static int num_updata = 60;
 Flash:         242604 B              236.92 KB
 Flash:         242604 B              236.92 KB
 RAM:            19072 B               18.62 KB
 RAM:            19072 B               18.62 KB
 
 
-
-
+#define VERSION_HK "1.15.41(HK)"         //版本
+#define VERSION_ZP "1.15.1(ZP)"         //版本
+#define CompileTime "20210601"
+## 更新说明
+- 1.0转盘增加延时消抖
 
 
 
 
 
 

+ 6 - 6
Application_GK_CBD/.cproject

@@ -20,7 +20,7 @@
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" useByScannerDiscovery="false" value="true" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" useByScannerDiscovery="false" value="true" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.1365878149" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" useByScannerDiscovery="false"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.1365878149" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" useByScannerDiscovery="false"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.709136944" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" useByScannerDiscovery="false" value="true" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.709136944" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" useByScannerDiscovery="false" value="true" valueType="boolean"/>
-							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1986446770" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1986446770" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.more" valueType="enumerated"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1312975261" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" useByScannerDiscovery="true" value="false" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1312975261" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" useByScannerDiscovery="true" value="false" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.1538128212" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" useByScannerDiscovery="true" value="false" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.1538128212" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" useByScannerDiscovery="true" value="false" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.2136804218" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
 							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.2136804218" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
@@ -68,7 +68,6 @@
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/libraries/CMSIS/Device/ST/STM32F1xx/Include}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/libraries/CMSIS/Device/ST/STM32F1xx/Include}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/libraries/CMSIS/Include}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/libraries/CMSIS/Include}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/libraries/STM32F1xx_HAL_Driver/Inc}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/libraries/STM32F1xx_HAL_Driver/Inc}&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Application_CBD/applications}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//.}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//.}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//packages/EasyFlash-latest/inc}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//packages/EasyFlash-latest/inc}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//packages/LedBlink-latest}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//packages/LedBlink-latest}&quot;"/>
@@ -90,6 +89,7 @@
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//rt-thread/include}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//rt-thread/include}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//rt-thread/libcpu/arm/common}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//rt-thread/libcpu/arm/common}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//rt-thread/libcpu/arm/cortex-m3}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc://${ProjName}//rt-thread/libcpu/arm/cortex-m3}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;D:\RT-ThreadStudio\workspace\IOT_CBD_BZY_CTRL\Application_GK_CBD\applications&quot;"/>
 								</option>
 								</option>
 								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.100549972" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
 								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.100549972" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
 									<listOptionValue builtIn="false" value="DEBUG"/>
 									<listOptionValue builtIn="false" value="DEBUG"/>
@@ -114,7 +114,9 @@
 									<listOptionValue builtIn="false" value="c"/>
 									<listOptionValue builtIn="false" value="c"/>
 									<listOptionValue builtIn="false" value="m"/>
 									<listOptionValue builtIn="false" value="m"/>
 								</option>
 								</option>
-								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.paths.36884122" name="Library search path (-L)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.paths" useByScannerDiscovery="false"/>
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.paths.36884122" name="Library search path (-L)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.paths" useByScannerDiscovery="false" valueType="libPaths">
+									<listOptionValue builtIn="false" value="/Application_GK_CBD/applications"/>
+								</option>
 								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other.396049466" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other" useByScannerDiscovery="false" value="" valueType="string"/>
 								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other.396049466" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other" useByScannerDiscovery="false" value="" valueType="string"/>
 								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref.1645737861" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref" useByScannerDiscovery="false" value="true" valueType="boolean"/>
 								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref.1645737861" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref" useByScannerDiscovery="false" value="true" valueType="boolean"/>
 								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input.334732222" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input">
 								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input.334732222" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input">
@@ -219,9 +221,7 @@
 	</storageModule>
 	</storageModule>
 	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 	<storageModule moduleId="refreshScope" versionNumber="2">
 	<storageModule moduleId="refreshScope" versionNumber="2">
-		<configuration configurationName="Debug">
-			<resource resourceType="PROJECT" workspacePath="/Application_CBD"/>
-		</configuration>
+		<configuration configurationName="Debug"/>
 	</storageModule>
 	</storageModule>
 	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
 	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
 	<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings">
 	<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings">

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

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<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.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" 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="-178370071162350467" 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="-139343116707329832" 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.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>
 			</provider>

+ 73 - 0
Application_GK_CBD/.settings/org.eclipse.cdt.codan.core.prefs

@@ -0,0 +1,73 @@
+eclipse.preferences.version=1
+org.eclipse.cdt.codan.checkers.errnoreturn=-Warning
+org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false}
+org.eclipse.cdt.codan.checkers.errreturnvalue=-Error
+org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"}
+org.eclipse.cdt.codan.checkers.nocommentinside=-Error
+org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"}
+org.eclipse.cdt.codan.checkers.nolinecomment=-Error
+org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"}
+org.eclipse.cdt.codan.checkers.noreturn=-Error
+org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false}
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"}
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"}
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"}
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"}
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false,enable_fallthrough_quickfix_param\=>false}
+org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning
+org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"}
+org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning
+org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true}
+org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid 'decltype(auto)' specifier\\")"}
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"\u5B57\u6BB5\u65E0\u6CD5\u88AB\u89E3\u6790\\")"}
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"\u51FD\u6570\u65E0\u6CD5\u88AB\u89E3\u6790\\")"}
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"\u65E0\u6548\u53C2\u6570\\")"}
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"}
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"}
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"}
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"\u65B9\u6CD5\u65E0\u6CD5\u88AB\u89E3\u6790\\")"}
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"}
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"}
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"}
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"}
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"}
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"}
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false}
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false}
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"}
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"\u672A\u4F7F\u7528\u7684\u9759\u6001\u51FD\u6570\\")",macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")}
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"}

+ 73 - 41
Application_GK_CBD/applications/control.c

@@ -18,6 +18,7 @@
 #define DBG_LVL LOG_LVL_INFO
 #define DBG_LVL LOG_LVL_INFO
 #include "dtu_uart2.h"
 #include "dtu_uart2.h"
 #include "sht30_collect.h"
 #include "sht30_collect.h"
+
 //工作检测
 //工作检测
 #define WORK_CHECK_THREAD_PRIORITY         23      //线程优先级
 #define WORK_CHECK_THREAD_PRIORITY         23      //线程优先级
 #define WORK_CHECK_THREAD_STACK_SIZE       1024    //栈大小
 #define WORK_CHECK_THREAD_STACK_SIZE       1024    //栈大小
@@ -199,6 +200,64 @@ void turnzp(void)
     HMI_WRITE("sysTest.switchClear.val=%d",0);
     HMI_WRITE("sysTest.switchClear.val=%d",0);
     rt_thread_delay(1000);
     rt_thread_delay(1000);
 }
 }
+//雨控电机
+void ctr_rain_Motor(uint8_t r_m_s)
+{
+    rt_uint16_t check_rlt = 0;
+    rt_pin_mode(CTR_R_LOW, PIN_MODE_OUTPUT);
+
+    rt_pin_mode(CLEAR_R, PIN_MODE_OUTPUT);
+    rt_pin_mode(CLEAR_L, PIN_MODE_OUTPUT);
+    //雨控限位
+    rt_pin_mode(CTR_RO_LIMIT,PIN_MODE_INPUT);
+    rt_pin_mode(CTR_RC_LIMIT,PIN_MODE_INPUT);
+    rt_pin_write(CTR_R_LOW,OFF);
+    rt_pin_write(CLEAR_R,OFF);
+    rt_pin_write(CLEAR_L,OFF);
+    if(r_m_s==OPEN)
+    {
+        if(rt_pin_read(CTR_RO_LIMIT)==0)
+            rt_thread_delay(100);
+        if(rt_pin_read(CTR_RO_LIMIT)==0) return;
+        rt_pin_write(CLEAR_R,OFF);
+        rt_pin_write(CLEAR_L,ON);
+        while(rt_pin_read(CTR_RO_LIMIT)!=0)
+        {
+            check_rlt++;
+            rt_thread_delay(20);
+            if(check_rlt==500)  //超时10s
+            {
+                break;
+            }
+        }
+        rt_pin_write(CLEAR_R,OFF);
+        rt_pin_write(CLEAR_L,OFF);
+        check_rlt = 0;
+    }
+    else if (r_m_s==CLOSE) {
+        if(rt_pin_read(CTR_RC_LIMIT)==0)
+            rt_thread_delay(100);
+        if(rt_pin_read(CTR_RC_LIMIT)==0) return;
+        rt_pin_write(CLEAR_R,ON);
+        rt_pin_write(CLEAR_L,OFF);
+        while(rt_pin_read(CTR_RC_LIMIT)!=0)
+        {
+            check_rlt++;
+            rt_thread_delay(20);
+            if(check_rlt==500)  //超时10s
+            {
+                break;
+            }
+        }
+        check_rlt = 0;
+        rt_pin_write(CLEAR_R,OFF);
+        rt_pin_write(CLEAR_L,OFF);
+    }
+    else {
+        rt_pin_write(CLEAR_R,OFF);
+        rt_pin_write(CLEAR_L,OFF);
+    }
+}
 //清扫-常闭型限位开关
 //清扫-常闭型限位开关
 //新结构使用推杆电机做清扫
 //新结构使用推杆电机做清扫
 uint8_t ctr_clear(uint16_t status_clear)
 uint8_t ctr_clear(uint16_t status_clear)
@@ -462,65 +521,33 @@ void calorstat(uint16_t heat_time)
 void HardWare_Init(uint8_t boot)
 void HardWare_Init(uint8_t boot)
 {
 {
     Beep_Tip(200);
     Beep_Tip(200);
+
+    //雨控电机归位
+    ctr_rain_Motor(OFF);
     //关闭上仓门
     //关闭上仓门
     ctr_cangmen_up(OFF);
     ctr_cangmen_up(OFF);
 
 
-
-    if(boot==1)
-    {
-        HMI_WRITE("hardcheck.checktip.txt=\"上仓门电机已停止!!!\"");
-        rt_thread_delay(1000);
-    }
     //关闭下仓门电机
     //关闭下仓门电机
     ctr_cangmen_down(OFF);
     ctr_cangmen_down(OFF);
-    if(boot==1)
-    {
-        HMI_WRITE("hardcheck.checktip.txt=\"下仓门电机已停止!!!\"");
-        rt_thread_delay(1000);
-    }
 
 
     //关闭镇流器
     //关闭镇流器
     ctr_lamp(OFF);
     ctr_lamp(OFF);
-    if(boot==1)
-    {
-        HMI_WRITE("hardcheck.checktip.txt=\"镇流器已关闭!!!\"");
-        rt_thread_delay(1000);
-    }
+
     //关闭震动电机
     //关闭震动电机
     ctr_shake(OFF,0);
     ctr_shake(OFF,0);
-    if(boot==1)
-    {
-        HMI_WRITE("hardcheck.checktip.txt=\"震动电机已关闭!!!\"");
-        rt_thread_delay(1000);
-    }
+
     //关闭清扫电机
     //关闭清扫电机
 
 
-    if(boot==1)
-    {
-        HMI_WRITE("hardcheck.checktip.txt=\"清扫电机已关闭!!!\"");
-        rt_thread_delay(1000);
-    }
     //关闭加热
     //关闭加热
     ctr_Heat(OFF);
     ctr_Heat(OFF);
-    if(boot==1)
-    {
-        HMI_WRITE("hardcheck.checktip.txt=\"加热带已关闭!!!\"");
-        rt_thread_delay(1000);
-    }
+
     //关闭补光灯
     //关闭补光灯
     ctr_led(OFF);
     ctr_led(OFF);
-    if(boot==1)
-    {
-        HMI_WRITE("hardcheck.checktip.txt=\"补光灯已关闭!!!\"");
-        rt_thread_delay(1000);
-    }
+
+
     //关闭12V供电(海康相机,RTU)
     //关闭12V供电(海康相机,RTU)
     ctr_photo(OFF);
     ctr_photo(OFF);
-    if(boot==1)
-    {
-        HMI_WRITE("hardcheck.checktip.txt=\"12V供电已关闭!!!\"");
-        rt_thread_delay(1000);
-    }
+
 
 
 }
 }
 //拍照
 //拍照
@@ -589,6 +616,8 @@ void ResetInit(void)
         rt_kprintf("欠压!!!\n");
         rt_kprintf("欠压!!!\n");
         return;
         return;
     }
     }
+    //切换排水
+    ctr_rain_Motor(CLOSE);
     //7.关闭上仓门
     //7.关闭上仓门
     device_status.ctr_up_motor = 2;
     device_status.ctr_up_motor = 2;
     while(device_status.ctr_up_motor!=0)
     while(device_status.ctr_up_motor!=0)
@@ -801,6 +830,9 @@ void WorkTast(void)
         //1.打开灯管
         //1.打开灯管
         ctr_lamp(ON);
         ctr_lamp(ON);
         rt_kprintf("打开灯管!!!\n");
         rt_kprintf("打开灯管!!!\n");
+        rt_thread_delay(5000);
+        //切换通道为落虫
+        ctr_rain_Motor(OPEN);
         //2.打开上仓门
         //2.打开上仓门
         rt_kprintf("打开上仓门!!!\n");
         rt_kprintf("打开上仓门!!!\n");
         device_status.ctr_up_motor = 1;
         device_status.ctr_up_motor = 1;

+ 5 - 3
Application_GK_CBD/applications/control.h

@@ -31,7 +31,7 @@ typedef struct{
     uint8_t lamp_status;    //灯管状态   0-关   1-开
     uint8_t lamp_status;    //灯管状态   0-关   1-开
     uint8_t up_status;      //上仓门状态 0-停止 1-打开 2-关闭
     uint8_t up_status;      //上仓门状态 0-停止 1-打开 2-关闭
     uint8_t down_status;    //下仓门状态 0-停止 1-打开 2-关闭
     uint8_t down_status;    //下仓门状态 0-停止 1-打开 2-关闭
-    uint8_t clear_status;   //清扫状态   0-停止 1-开始
+    uint8_t clear_status;   //仓门状态 0-停止 1-落虫 2-排水
     uint8_t shake_ws;       //震动       0-关   1-开
     uint8_t shake_ws;       //震动       0-关   1-开
     uint8_t heatvalue;
     uint8_t heatvalue;
     uint8_t ctr_up_motor;   //上仓门,    1打开,0关闭
     uint8_t ctr_up_motor;   //上仓门,    1打开,0关闭
@@ -135,7 +135,6 @@ typedef struct{
 //清扫限位
 //清扫限位
 #define CLEAR_R_LIMIT GET_PIN(C,13)
 #define CLEAR_R_LIMIT GET_PIN(C,13)
 #define CLEAR_L_LIMIT GET_PIN(B,9)
 #define CLEAR_L_LIMIT GET_PIN(B,9)
-
 /***************************高空测报灯*************************/
 /***************************高空测报灯*************************/
 
 
 //上仓门电机限位
 //上仓门电机限位
@@ -145,9 +144,11 @@ typedef struct{
 #define CTR_DWO_LIMIT GET_PIN(B,5)
 #define CTR_DWO_LIMIT GET_PIN(B,5)
 #define CTR_DWC_LIMIT GET_PIN(B,8)
 #define CTR_DWC_LIMIT GET_PIN(B,8)
 //雨控电机限位,控制排水和落虫
 //雨控电机限位,控制排水和落虫
-
 #define CTR_RO_LIMIT GET_PIN(B,15)
 #define CTR_RO_LIMIT GET_PIN(B,15)
 #define CTR_RC_LIMIT GET_PIN(C,6)
 #define CTR_RC_LIMIT GET_PIN(C,6)
+
+#define CTR_R_LOW GET_PIN(B,14)
+
 /***************************************************************/
 /***************************************************************/
 uint8_t ctr_Heat(uint8_t status_heat);          //加热
 uint8_t ctr_Heat(uint8_t status_heat);          //加热
 uint8_t ctr_cangmen_up(uint8_t status_up);      //上仓门
 uint8_t ctr_cangmen_up(uint8_t status_up);      //上仓门
@@ -156,6 +157,7 @@ uint8_t ctr_lamp(uint8_t status_lamp);          //镇流器
 uint8_t ctr_shake(uint8_t status_shake,uint16_t shake_sec);        //震动
 uint8_t ctr_shake(uint8_t status_shake,uint16_t shake_sec);        //震动
 uint8_t ctr_clear(uint16_t status_clear);       //清扫
 uint8_t ctr_clear(uint16_t status_clear);       //清扫
 void ctr_TG_Clear(uint16_t clear_timeout);      //清扫2
 void ctr_TG_Clear(uint16_t clear_timeout);      //清扫2
+void ctr_rain_Motor(uint8_t r_m_s);             //雨控电机
 uint8_t ctr_led(uint8_t status_led);            //补光灯
 uint8_t ctr_led(uint8_t status_led);            //补光灯
 void calorstat(uint16_t heat_time);             //恒温
 void calorstat(uint16_t heat_time);             //恒温
 void ctr_router(uint8_t status_router);         //路由器
 void ctr_router(uint8_t status_router);         //路由器

+ 83 - 46
Application_GK_CBD/applications/hmi.c

@@ -186,8 +186,8 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
         //更新dtu/rtu版本
         //更新dtu/rtu版本
         HMI_WRITE("debug.t9.txt=\"%s\"",device_status.driver_4g);
         HMI_WRITE("debug.t9.txt=\"%s\"",device_status.driver_4g);
         //更新时间
         //更新时间
-        HMI_WRITE("menu.rtc.txt=\"%04d-%02d-%02d %02d:%02d:%02d\"",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
-        HMI_WRITE("workSta.rtc.txt=\"%04d-%02d-%02d %02d:%02d:%02d\"",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
+        HMI_WRITE("menu.rtc.txt=\"%02d:%02d:%02d\"",tm.tm_hour,tm.tm_min,tm.tm_sec);
+        //HMI_WRITE("workSta.rtc.txt=\"%04d-%02d-%02d %02d:%02d:%02d\"",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
         HMI_WRITE("set.t0.txt=\"%d\"",tm.tm_hour);
         HMI_WRITE("set.t0.txt=\"%d\"",tm.tm_hour);
         HMI_WRITE("set.t1.txt=\"%d\"",tm.tm_min);
         HMI_WRITE("set.t1.txt=\"%d\"",tm.tm_min);
         HMI_WRITE("set.t2.txt=\"%d\"",tm.tm_sec);
         HMI_WRITE("set.t2.txt=\"%d\"",tm.tm_sec);
@@ -296,11 +296,14 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
         else if (device_status.version_type==1) {
         else if (device_status.version_type==1) {
             turnzp();
             turnzp();
         }
         }
+        ctr_rain_Motor(OPEN);
     }
     }
     //震动
     //震动
     else if (strstr(rx_buffer,"putTest.switchShake=1")!=NULL) {
     else if (strstr(rx_buffer,"putTest.switchShake=1")!=NULL) {
         rt_kprintf("\n震动!\n");
         rt_kprintf("\n震动!\n");
-        ctr_shake(ON,device_status.shake_sec);
+        rt_pin_mode(SHAKE_SW, PIN_MODE_OUTPUT);
+        rt_pin_write(SHAKE_SW,ON);
+        //ctr_shake(ON,device_status.shake_sec);
     }
     }
     //打开补光
     //打开补光
     else if (strstr(rx_buffer,"putTest.switchFill=1")!=NULL) {
     else if (strstr(rx_buffer,"putTest.switchFill=1")!=NULL) {
@@ -576,35 +579,54 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
 //入口函数-电机控制及
 //入口函数-电机控制及
 static void Ctr_Mortor_entry(void* parameter)
 static void Ctr_Mortor_entry(void* parameter)
 {
 {
-   rt_uint32_t limit_current = 2000;     //推杆电击限制电流1A
-   static rt_uint16_t num_up_open = 200;    //20s
-   static rt_uint16_t num_up_close = 200;   //
-   static rt_uint16_t num_down_open = 200;  //
-   static rt_uint16_t num_down_close = 200;  //
-   static rt_uint16_t photo_led_sec = 450;  //45S
+   rt_uint32_t limit_current = 2000;     //推杆电机限制电流1A
+   static rt_uint16_t num_up_open = 1000;    //20s
+   static rt_uint16_t num_up_close = 1000;   //
+   static rt_uint16_t num_down_open = 1000;  //
+   static rt_uint16_t num_down_close = 1000;  //
+   static rt_uint16_t photo_led_sec = 300;  //45S
+   //上限位
+   rt_pin_mode(CTR_UPO_LIMIT,PIN_MODE_INPUT);
+   rt_pin_mode(CTR_UPC_LIMIT,PIN_MODE_INPUT);
+   //下限位
+   rt_pin_mode(CTR_DWO_LIMIT,PIN_MODE_INPUT);
+   rt_pin_mode(CTR_DWC_LIMIT,PIN_MODE_INPUT);
+
     while(1)
     while(1)
     {
     {
         if(device_status.ctr_up_motor==1)
         if(device_status.ctr_up_motor==1)
         {
         {
             //打开上仓门
             //打开上仓门
-            ctr_cangmen_up(OPEN);
+            if(rt_pin_read(CTR_UPO_LIMIT)==1)
+            {
+                ctr_cangmen_up(OPEN);
+            }
+            else {
+                ctr_cangmen_up(OFF);
+            }
             num_up_open--;
             num_up_open--;
             //如果未工作且上仓门电机电流大于1A,立即停止,记录到Flash,上报预警
             //如果未工作且上仓门电机电流大于1A,立即停止,记录到Flash,上报预警
             if(atoi(device_status.power)>limit_current)
             if(atoi(device_status.power)>limit_current)
             {
             {
                 ctr_cangmen_up(OFF);
                 ctr_cangmen_up(OFF);
-                num_up_open = 200;
+                num_up_open = 1000;
                 rt_kprintf("*************************上仓门电机打开堵转!!!**********************%d\n",atoi(device_status.power));
                 rt_kprintf("*************************上仓门电机打开堵转!!!**********************%d\n",atoi(device_status.power));
             }
             }
             if (num_up_open == 0)
             if (num_up_open == 0)
             {
             {
                 ctr_cangmen_up(OFF);
                 ctr_cangmen_up(OFF);
-                num_up_open = 200;
+                num_up_open = 1000;
             }
             }
         }
         }
         else if(device_status.ctr_up_motor==2)
         else if(device_status.ctr_up_motor==2)
         {
         {
-            ctr_cangmen_up(CLOSE);
+            if(rt_pin_read(CTR_UPC_LIMIT)==1)
+            {
+                ctr_cangmen_up(CLOSE);
+            }
+            else {
+                ctr_cangmen_up(OFF);
+            }
             num_up_close --;
             num_up_close --;
             if(atoi(device_status.power)>limit_current)
             if(atoi(device_status.power)>limit_current)
             {
             {
@@ -621,7 +643,13 @@ static void Ctr_Mortor_entry(void* parameter)
         }
         }
         if (device_status.ctr_down_motor == 1)
         if (device_status.ctr_down_motor == 1)
         {
         {
+            if(rt_pin_read(CTR_DWO_LIMIT)==1)
+            {
             ctr_cangmen_down(OPEN);
             ctr_cangmen_down(OPEN);
+            }
+            else {
+                ctr_cangmen_down(OFF);
+            }
             num_down_open--;
             num_down_open--;
             if(atoi(device_status.power)>limit_current)
             if(atoi(device_status.power)>limit_current)
             {
             {
@@ -637,7 +665,13 @@ static void Ctr_Mortor_entry(void* parameter)
         }
         }
         else if (device_status.ctr_down_motor == 2)
         else if (device_status.ctr_down_motor == 2)
         {
         {
-            ctr_cangmen_down(CLOSE);
+            if(rt_pin_read(CTR_DWC_LIMIT)==1)
+            {
+                ctr_cangmen_down(CLOSE);
+            }
+            else {
+                ctr_cangmen_down(OFF);
+            }
             num_down_close--;
             num_down_close--;
             if(atoi(device_status.power)>limit_current)
             if(atoi(device_status.power)>limit_current)
             {
             {
@@ -683,7 +717,7 @@ static void Ctr_Mortor_entry(void* parameter)
                 HMI_WRITE("sysTest.switchFill.val=0");
                 HMI_WRITE("sysTest.switchFill.val=0");
             }
             }
         }
         }
-        rt_thread_delay(100);
+        rt_thread_delay(20);
         //rt_kprintf("action num is:%d%d%d",num_up_open,num_up_close,num_down_open,num_down_close,num_clear);
         //rt_kprintf("action num is:%d%d%d",num_up_open,num_up_close,num_down_open,num_down_close,num_clear);
     }
     }
 }
 }
@@ -849,7 +883,8 @@ void Check_ParamConfig(void)
         else if (device_status.version_type==4) {
         else if (device_status.version_type==4) {
             rt_sprintf(device_status.driver, "%s",VERSION_HK);
             rt_sprintf(device_status.driver, "%s",VERSION_HK);
         }
         }
-
+        device_status.version_type=10;
+        rt_sprintf(device_status.driver, "GK3.0");
         rt_kprintf("SOFTWARE VERSION:%s-imei:%s--iccid:%s\n",device_status.driver,device_status.imei,device_status.iccid);
         rt_kprintf("SOFTWARE VERSION:%s-imei:%s--iccid:%s\n",device_status.driver,device_status.imei,device_status.iccid);
         rt_kprintf("read flash paramconfis:%d-%s-%s\r\n",device_status.version_type,device_status.driver_bl,device_status.driver_compile);
         rt_kprintf("read flash paramconfis:%d-%s-%s\r\n",device_status.version_type,device_status.driver_bl,device_status.driver_compile);
         rt_kprintf("开机次数:%d\n",device_status.rebootcnt);
         rt_kprintf("开机次数:%d\n",device_status.rebootcnt);
@@ -880,36 +915,38 @@ void Check_ParamConfig(void)
     else {
     else {
 
 
         //初始化联网状态
         //初始化联网状态
-        rt_sprintf(device_status.net,"1");
-        rt_sprintf(device_status.csq,"0");
-        rt_sprintf(device_status.sim,"1");
-        Hmi_Fresh();
-        dtu_data_play();
-        sht30_collect();
-        mb_master_samlpe();
-        uint16_t connect_num=0;
+//        rt_sprintf(device_status.net,"1");
+//        rt_sprintf(device_status.csq,"0");
+//        rt_sprintf(device_status.sim,"1");
+
+//        uint16_t connect_num=0;
         //等待联网,
         //等待联网,
-        while(atoi(device_status.net)==1)
+//        while(atoi(device_status.net)==1)
+//        {
+//            char *readinfo =  makeJson_ReadInfo();
+//            DTU_Write("%s",readinfo);
+//            rt_free(readinfo);
+//            rt_thread_delay(1000);
+//            connect_num++;
+//            rt_kprintf("联网中......%d\n",connect_num);
+//            //超时时间为3分钟
+//            if(connect_num==60)
+//            {
+//                device_status.timeSwitch = 0;
+//                //保存光控变量
+//                ef_set_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch));
+//                rt_kprintf("Time not set:%04d-%02d-%02d %02d:%02d:%02d\n",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
+//                set_date(2020, 1, 1);
+//                set_time(0, 0, 0);
+//                break;
+//            }
+//            if(tm.tm_year>=2021)
+//            break;
+//        }
+        if(tm.tm_year+1900<2021)
         {
         {
-            char *readinfo =  makeJson_ReadInfo();
-            DTU_Write("%s",readinfo);
-            rt_free(readinfo);
-            rt_thread_delay(1000);
-            connect_num++;
-            rt_kprintf("联网中......%d\n",connect_num);
-            //超时时间为3分钟
-            if(connect_num==180)
-            {
-                device_status.timeSwitch = 0;
-                //保存光控变量
-                ef_set_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch));
-                rt_kprintf("Time not set:%04d-%02d-%02d %02d:%02d:%02d\n",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
-                set_date(2020, 1, 1);
-                set_time(0, 0, 0);
-                break;
-            }
-            if(tm.tm_year>=2021)
-            break;
+            set_date(2021, 1, 1);
+            set_time(0, 0, 0);
         }
         }
         DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
         DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
     }
     }
@@ -921,7 +958,7 @@ void ResetParamDefault(void)
     device_status.startBar = 20;    //定时开始时间
     device_status.startBar = 20;    //定时开始时间
     device_status.stopBar = 5;      //定时结束时间
     device_status.stopBar = 5;      //定时结束时间
     device_status.heattime = 20;    //加热时间
     device_status.heattime = 20;    //加热时间
-    device_status.shake_ws = 0;     //针对开关
+    device_status.shake_ws = 1;     //针对开关
     device_status.shake_sec = 1;    //震动时间1-100ms
     device_status.shake_sec = 1;    //震动时间1-100ms
     device_status.sunBar = 8;       //光控定时时长
     device_status.sunBar = 8;       //光控定时时长
     device_status.tph = 70;         //高温保护阈值
     device_status.tph = 70;         //高温保护阈值
@@ -954,7 +991,7 @@ void ResetParamDefault_DC(void)
     device_status.startBar = 20;    //定时开始时间
     device_status.startBar = 20;    //定时开始时间
     device_status.stopBar = 0;      //定时结束时间
     device_status.stopBar = 0;      //定时结束时间
     device_status.heattime = 20;    //加热时间
     device_status.heattime = 20;    //加热时间
-    device_status.shake_ws = 0;     //针对开关
+    device_status.shake_ws = 1;     //针对开关
     device_status.shake_sec = 1;    //震动时间1-100ms
     device_status.shake_sec = 1;    //震动时间1-100ms
     device_status.sunBar = 4;       //光控定时时长
     device_status.sunBar = 4;       //光控定时时长
     device_status.tph = 70;         //高温保护阈值
     device_status.tph = 70;         //高温保护阈值

+ 5 - 7
Application_GK_CBD/applications/main.c

@@ -57,21 +57,19 @@ int main(void)
     //是否触发固件更新
     //是否触发固件更新
     if(device_status.update_flag==0)
     if(device_status.update_flag==0)
     {
     {
-        //屏幕初始化
-        //Hmi_Fresh();
-        //传感器数据采集线程
-        //sht30_collect();
-        //mb_master_samlpe();
+
         //开机自检
         //开机自检
         HardWare_Check(0);
         HardWare_Check(0);
+        Hmi_Fresh();        //屏幕初始化
+        dtu_data_play();
+        sht30_collect();    //传感器数据采集线程
+        mb_master_samlpe();
         //工作状态置位线程
         //工作状态置位线程
         Workstatus_check();
         Workstatus_check();
         /***************/
         /***************/
         //工作流程
         //工作流程
         Work_Loop_Task();
         Work_Loop_Task();
         /*******************/
         /*******************/
-        //数据透传
-        //dtu_data_play();
     }
     }
     //看门狗初始化
     //看门狗初始化
      wdt_init();
      wdt_init();

+ 1 - 1
Application_GK_CBD/makefile.targets

@@ -4,4 +4,4 @@ clean2:
 	-@echo ' '
 	-@echo ' '
 
 
 
 
-*.elf: $(wildcard D:/RT-ThreadStudio/workspace/IOT_CBD_BZY_CTRL/Application_CBD/link.lds)
+*.elf: $(wildcard D:/RT-ThreadStudio/workspace/IOT_CBD_BZY_CTRL/Application_GK_CBD/link.lds)

+ 2 - 1
Application_GK_CBD/packages/fal-latest/samples/porting/fal_flash_sfud_port.c

@@ -113,7 +113,8 @@ static int rt_hw_on_chip_flash_init(void)
     fal_init();
     fal_init();
     return RT_EOK;
     return RT_EOK;
 }
 }
-INIT_COMPONENT_EXPORT(rt_hw_on_chip_flash_init);
+//INIT_COMPONENT_EXPORT(rt_hw_on_chip_flash_init);
+INIT_ENV_EXPORT(rt_hw_on_chip_flash_init);
 #endif
 #endif
 
 
 #endif /* FAL_USING_SFUD_PORT */
 #endif /* FAL_USING_SFUD_PORT */