浏览代码

1.消除编译告警

libo 2 年之前
父节点
当前提交
a83f00bd32
共有 4 个文件被更改,包括 25 次插入9 次删除
  1. 7 1
      Inc/md5c.h
  2. 4 2
      Src/TerminalSlave485.c
  3. 13 5
      Src/md5c.c
  4. 1 1
      lib/lib_buffer_test.c

+ 7 - 1
Inc/md5c.h

@@ -1,5 +1,7 @@
 #ifndef __MD5C_H__
 #define __MD5C_H__
+
+#define MD5_FILE_ENABLE   0
 /* POINTER defines a generic pointer type */ 
 typedef unsigned char * POINTER; 
  
@@ -20,8 +22,12 @@ typedef struct {
 void MD5Init (MD5_CTX *context); 
 void MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen); 
 void MD5UpdaterString(MD5_CTX *context,const char *string); 
-int MD5FileUpdateFile (MD5_CTX *context,char *filename); 
 void MD5Final (unsigned char digest[16], MD5_CTX *context); 
 void MDString (char *string,unsigned char digest[16]); 
+
+#if MD5_FILE_ENABLE
+int MD5FileUpdateFile (MD5_CTX *context,char *filename); 
 int MD5File (char *filename,unsigned char digest[16]); 
+#endif	
+
 #endif

+ 4 - 2
Src/TerminalSlave485.c

@@ -507,8 +507,10 @@ void Reboot_System()
 	  {
 		  __nop();
 	  }
+#else
+		HAL_NVIC_SystemReset();
 #endif
-	HAL_NVIC_SystemReset();
+
 }
 
 int Flash_MD5_Check(uint32_t addr,uint32_t len)
@@ -5579,7 +5581,7 @@ int 	Process_CMD_0x39_RemoteCali(uint8_t dataMode)
 					memset((void *)&T2C_RemoteCaliDat001, 0x00, sizeof(T2C_RemoteCaliDat001));	
 					memset((void *)Pass41SensorScanParam.rx_buf, 0x00, sizeof(Pass41SensorScanParam.rx_buf));
 					return 1;
-				}break;				
+				};//break;				
 				//end boly
 				default:
 					T2C_RemoteCaliDat001.NumberOfRegs = sprintf((char *)T2C_RemoteCaliDat001.PayLoadData, "Write Address Error! %08X\r\n", T2C_RemoteCaliDat001.AddrRegStart);

+ 13 - 5
Src/md5c.c

@@ -321,6 +321,15 @@ void MDString (char *string,unsigned char digest[16])
  MD5Update (&context, (unsigned char *)string, len); 
  MD5Final (digest, &context); 
 } 
+
+void MD5UpdaterString(MD5_CTX *context,const char *string) 
+{ 
+ unsigned int len = strlen (string); 
+ MD5Update (context, (unsigned char *)string, len); 
+} 
+
+
+#if MD5_FILE_ENABLE
 /* Digests a file and prints the result. 
  */ 
 int MD5File (char *filename,unsigned char digest[16]) 
@@ -342,11 +351,7 @@ int MD5File (char *filename,unsigned char digest[16])
  } 
  return 0; 
 } 
-void MD5UpdaterString(MD5_CTX *context,const char *string) 
-{ 
- unsigned int len = strlen (string); 
- MD5Update (context, (unsigned char *)string, len); 
-} 
+
 int MD5FileUpdateFile (MD5_CTX *context,char *filename) 
 { 
  FILE *file; 
@@ -362,3 +367,6 @@ int MD5FileUpdateFile (MD5_CTX *context,char *filename)
  } 
  return 0; 
 } 
+#endif
+
+

+ 1 - 1
lib/lib_buffer_test.c

@@ -114,4 +114,4 @@ int main()
         printf("Failed to initialize");
     return 0;
 }     
-#endif
+#endif