A simple CRC library used to verify configuration data

Fork of CRC by Andrew Lindsay

Files at this revision

API Documentation at this revision

Comitter:
SomeRandomBloke
Date:
Tue Feb 02 13:56:09 2016 +0000
Parent:
1:ec8513f94d23
Child:
3:599d283e5a44
Commit message:
Updates to menu, added updated crc

Changed in this revision

crc.cpp Show annotated file Show diff for this revision Revisions of this file
crc.h Show annotated file Show diff for this revision Revisions of this file
--- a/crc.cpp	Tue May 14 22:14:09 2013 +0000
+++ b/crc.cpp	Tue Feb 02 13:56:09 2016 +0000
@@ -1,15 +1,15 @@
 
 #define CRC32_POLYNOMIAL 0xEDB88320L
 
-void CRC32Value(unsigned long &CRC, unsigned char c)
+void CRC32Value(unsigned long &CRCval, unsigned char c)
 {
     /////////////////////////////////////////////////////////////////////////////////////
     //CRC must be initialized as zero 
     //c is a character from the sequence that is used to form the CRC
     //this code is a modification of the code from the Novatel OEM615 specification
     /////////////////////////////////////////////////////////////////////////////////////
-    unsigned long ulTemp1 = ( CRC >> 8 ) & 0x00FFFFFFL;
-    unsigned long ulCRC = ((int) CRC ^ c ) & 0xff ;
+    unsigned long ulTemp1 = ( CRCval >> 8 ) & 0x00FFFFFFL;
+    unsigned long ulCRC = ((int) CRCval ^ c ) & 0xff ;
     for (int  j = 8 ; j > 0; j-- )
     {
         if ( ulCRC & 1 )
@@ -21,7 +21,7 @@
             ulCRC >>= 1;
         }
     }
-    CRC = ulTemp1 ^ ulCRC;
+    CRCval = ulTemp1 ^ ulCRC;
 } 
 
 /* --------------------------------------------------------------------------
--- a/crc.h	Tue May 14 22:14:09 2013 +0000
+++ b/crc.h	Tue Feb 02 13:56:09 2016 +0000
@@ -2,7 +2,7 @@
 #ifndef CRC_H
 #define CRC_H
 
-void CRC32Value(unsigned long &CRC, unsigned char c);
+void CRC32Value(unsigned long &CRCval, unsigned char c);
 unsigned long CalculateBlockCRC32(unsigned long ulCount, unsigned char *ucBuffer );
 
 #endif