Explorar o código

增加了函数注释

yang684665 hai 1 ano
pai
achega
d7913f7eee

+ 1 - 1
app/App/main.c

@@ -124,7 +124,7 @@ int main(void)
 	mmodbus_init(1);
 	dlt645_init(1);
 
-	usart_data_transmit(COM_232, 'P');
+	usart_data_transmit(COM_232, '!');
 	//¿ªÆô¿´ÃŹ·
 //	fwdgt_init();
 	while (1)

+ 6 - 0
app/App/otaEvent.c

@@ -163,6 +163,12 @@ int8_t check_ota_event()
 		return 0;
 }
 
+/**
+ * @brief 专门用来解析往文件里写数据的响应数据
+ * 
+ * @param timeout 超时时间(ms)
+ * @return uint8_t 实际写入字节数
+ */
 uint8_t WaitResponse_value(int timeout)
 {
 	bool timeoutFlag = false;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1063 - 759
app/Proj/Listings/Ringzle.map


BIN=BIN
app/Proj/Objects/Ringzle.axf


BIN=BIN
app/Proj/Objects/Ringzle.bin


+ 17 - 17
app/Proj/Objects/Ringzle.build_log.htm

@@ -21,30 +21,30 @@ Target DLL:      Segger\JL2CM3.dll V2.99.40.0
 Dialog DLL:      TCM.DLL V1.53.0.0
  
 <h2>Project:</h2>
-d:\project\dtu_gateway\app\Proj\Ringzle.uvprojx
+D:\project\dtu_gateway\app\Proj\Ringzle.uvprojx
 Project File Date:  10/31/2023
 
 <h2>Output:</h2>
 *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\software\MDK5\ARM\ARMCC\Bin'
 Build target 'GD32F103C8T6'
-compiling otaEvent.c...
-..\App\otaEvent.h(26): warning:  #1295-D: Deprecated declaration check_ota_event - give arg types
-  int8_t check_ota_event();
+compiling main.c...
 ..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
   GATEWAY_PARAMS *get_gateway_config_params();
-..\App\otaEvent.c(164): warning:  #940-D: missing return statement at end of non-void function "check_ota_event" 
-  }
-..\App\otaEvent.c(168): warning:  #188-D: enumerated type mixed with another type
-  	bool timeoutFlag = false;
-..\App\otaEvent.c(171): warning:  #188-D: enumerated type mixed with another type
-  		timeoutFlag = true;
-..\App\otaEvent.c(251): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *"
-  						EC800MSendCmd(ota_data.data + 3,128);
-..\App\otaEvent.c(343): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *"
-  					EC800MSendCmd((uint8_t *)&ota_message,sizeof(OTA_MESSAGE));
-..\App\otaEvent.c: 7 warnings, 0 errors
+..\App\parseDeviceMessage.h(13): warning:  #1295-D: Deprecated declaration Read_Data - give arg types
+  void Read_Data();
+..\App\otaEvent.h(26): warning:  #1295-D: Deprecated declaration check_ota_event - give arg types
+  int8_t check_ota_event();
+..\App\main.c(66): warning:  #1295-D: Deprecated declaration fwdgt_init - give arg types
+  void fwdgt_init();
+..\App\main.c(67): warning:  #1295-D: Deprecated declaration task_fwdgt_reload - give arg types
+  void task_fwdgt_reload();
+..\App\main.c(104): warning:  #167-D: argument of type "char *" is incompatible with parameter of type "uint8_t *"
+   	http_load_config(httpURL);
+..\App\main.c(218): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *"
+  	if (EC800MGetUrl(httpURL,dmabuffer,BufferSize) == true) // 从http获取信息,获取成功则保存到本地
+..\App\main.c: 7 warnings, 0 errors
 linking...
-Program Size: Code=16468 RO-data=524 RW-data=172 ZI-data=82836  
+Program Size: Code=31292 RO-data=1696 RW-data=232 ZI-data=82968  
 FromELF: creating hex file...
 After Build - User command #1: fromelf --bin --output ./Objects/Ringzle.bin ./Objects/Ringzle.axf
 ".\Objects\Ringzle.axf" - 0 Error(s), 7 Warning(s).
@@ -60,7 +60,7 @@ Package Vendor: GigaDevice
   D:\software\MDK5\Pack\GigaDevice\GD32F10x_DFP\2.1.0\Device\Include
 
 <h2>Collection of Component Files used:</h2>
-Build Time Elapsed:  00:00:03
+Build Time Elapsed:  00:00:02
 </pre>
 </body>
 </html>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1679 - 688
app/Proj/Objects/Ringzle.htm


+ 1 - 1
app/Proj/Objects/Ringzle_GD32F103C8T6.dep

@@ -365,7 +365,7 @@ I (..\App\mmodbusConfig.h)(0x6538DC54)
 I (D:\software\MDK5\ARM\ARMCC\include\stdio.h)(0x60252374)
 I (..\dlt\inc\dlt645.h)(0x6538DC55)
 I (..\dlt\port\dlt645_port.h)(0x6538DC55)
-F (..\App\main.c)(0x6541FDDD)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ..\App -I ..\CMSIS -I ..\Firmware\Include -I ..\bsp -I ..\internet -I ..\cjson -I ..\dlt -I ..\dlt\inc -I ..\dlt\port -I ..\jsmn

-ID:\software\MDK5\Pack\GigaDevice\GD32F10x_DFP\2.1.0\Device\Include

-D__UVISION_VERSION="536" -DGD32F10X_XD -DUSE_STDPERIPH_DRIVER -DUSE_STDPERIPH_DRIVER -DGD32F10X_XD

-o .\objects\main.o --omf_browse .\objects\main.crf --depend .\objects\main.d)
+F (..\App\main.c)(0x65430EBC)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ..\App -I ..\CMSIS -I ..\Firmware\Include -I ..\bsp -I ..\internet -I ..\cjson -I ..\dlt -I ..\dlt\inc -I ..\dlt\port -I ..\jsmn

-ID:\software\MDK5\Pack\GigaDevice\GD32F10x_DFP\2.1.0\Device\Include

-D__UVISION_VERSION="536" -DGD32F10X_XD -DUSE_STDPERIPH_DRIVER -DUSE_STDPERIPH_DRIVER -DGD32F10X_XD

-o .\objects\main.o --omf_browse .\objects\main.crf --depend .\objects\main.d)
 I (..\CMSIS\gd32f10x.h)(0x6538DC54)
 I (..\CMSIS\core_cm3.h)(0x6538DC54)
 I (D:\software\MDK5\ARM\ARMCC\include\stdint.h)(0x6025237E)

BIN=BIN
app/Proj/Objects/main.crf


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 18 - 18
app/Proj/Ringzle.uvguix.IBM


+ 8 - 40
app/Proj/Ringzle.uvoptx

@@ -120,7 +120,7 @@
         <SetRegEntry>
           <Number>0</Number>
           <Key>DLGUARM</Key>
-          <Name>d</Name>
+          <Name></Name>
         </SetRegEntry>
         <SetRegEntry>
           <Number>0</Number>
@@ -157,9 +157,9 @@
         <Bp>
           <Number>0</Number>
           <Type>0</Type>
-          <LineNumber>84</LineNumber>
+          <LineNumber>159</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>134253286</Address>
+          <Address>134248204</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
@@ -168,55 +168,23 @@
           <BreakIfRCount>1</BreakIfRCount>
           <Filename>..\App\otaEvent.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression>\\Ringzle\../App/otaEvent.c\84</Expression>
+          <Expression>\\Ringzle\../App/otaEvent.c\159</Expression>
         </Bp>
         <Bp>
           <Number>1</Number>
           <Type>0</Type>
-          <LineNumber>127</LineNumber>
-          <EnabledFlag>1</EnabledFlag>
-          <Address>134253502</Address>
-          <ByteObject>0</ByteObject>
-          <HtxType>0</HtxType>
-          <ManyObjects>0</ManyObjects>
-          <SizeOfObject>0</SizeOfObject>
-          <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\App\otaEvent.c</Filename>
-          <ExecCommand></ExecCommand>
-          <Expression>\\Ringzle\../App/otaEvent.c\127</Expression>
-        </Bp>
-        <Bp>
-          <Number>2</Number>
-          <Type>0</Type>
-          <LineNumber>109</LineNumber>
-          <EnabledFlag>1</EnabledFlag>
-          <Address>134253410</Address>
-          <ByteObject>0</ByteObject>
-          <HtxType>0</HtxType>
-          <ManyObjects>0</ManyObjects>
-          <SizeOfObject>0</SizeOfObject>
-          <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\App\otaEvent.c</Filename>
-          <ExecCommand></ExecCommand>
-          <Expression>\\Ringzle\../App/otaEvent.c\109</Expression>
-        </Bp>
-        <Bp>
-          <Number>3</Number>
-          <Type>0</Type>
-          <LineNumber>159</LineNumber>
+          <LineNumber>84</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>134248376</Address>
+          <Address>0</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
           <SizeOfObject>0</SizeOfObject>
           <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>1</BreakIfRCount>
+          <BreakIfRCount>0</BreakIfRCount>
           <Filename>..\App\otaEvent.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression>\\Ringzle\../App/otaEvent.c\159</Expression>
+          <Expression></Expression>
         </Bp>
       </Breakpoint>
       <WatchWindow1>

+ 19 - 4
bootloader/HW/Source/boot.c

@@ -12,7 +12,15 @@
 
 load_a load_A;       
 
-//返回str在数组中的索引
+/**
+ * @brief 用strstr函数找出字节数组中的指定字符位置,如果没有返回NULL
+ * 
+ * @param strs 字节数组
+ * @param str 指定字符串
+ * @param first 字节数组偏移量
+ * @param len 字节数组长度
+ * @return char* 指定字符地址,如果没有返回NULL
+ */
 static char* find_string(char *strs, char *str,int first, int len)
 {
     int i = 0;
@@ -32,7 +40,14 @@ static char* find_string(char *strs, char *str,int first, int len)
     return start;
 }
 
-
+/**
+ * @brief 等待解析读文件命令发送完的返回数据
+ * 
+ * @param data 将解析的数据复制到data数组内
+ * @param timeout 超时时间
+ * @param datalen 需要复制的数据字节长度
+ * @return int 成功则返回复制的字节长度,失败返回-1
+ */
 int WaitForReadData(uint8_t* data,int timeout,int datalen)
 {
 	uint32_t len = 0;
@@ -99,7 +114,7 @@ void BootLoader_Brance(uint32_t app_byte)
 			task_fwdgt_reload();
 			int x = 0;
 			EC800MSendCmd(READ_otaDATA_FILE,strlen(READ_otaDATA_FILE));
-			Delay_Ms(200);
+			Delay_Ms(200);		//必要的200ms延迟
 			x = WaitForReadData(app_programmer,2000,1024);
 			// if((x != 1024) && (x != -1))
 			// {
@@ -129,7 +144,7 @@ void BootLoader_Brance(uint32_t app_byte)
 			task_fwdgt_reload();
 			int x = 0;
 			EC800MSendCmd(READ_otaDATA_FILE,strlen(READ_otaDATA_FILE));
-			Delay_Ms(200);
+			Delay_Ms(200);		//必要的200ms延迟
 			x = WaitForReadData(app_programmer,2000,app_byte % 1024);
 			// if(x != (app_byte % 1024) && (x != -1))
 			// {