Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:ec8513f94d23, committed 2013-05-14
- Comitter:
- sam_grove
- Date:
- Tue May 14 22:14:09 2013 +0000
- Parent:
- 0:28e16d33040f
- Commit message:
- untested but just formatted
Changed in this revision
| crc.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/crc.cpp Tue May 14 21:54:06 2013 +0000
+++ b/crc.cpp Tue May 14 22:14:09 2013 +0000
@@ -13,9 +13,13 @@
for (int j = 8 ; j > 0; j-- )
{
if ( ulCRC & 1 )
+ {
ulCRC = ( ulCRC >> 1 ) ^ CRC32_POLYNOMIAL;
+ }
else
+ {
ulCRC >>= 1;
+ }
}
CRC = ulTemp1 ^ ulCRC;
}
@@ -33,7 +37,10 @@
//the below code tests the CRC32Value procedure used in a markov form
//////////////////////////////////////////////////////////////////////
unsigned long CRC = 0;
- for (int i = 0; i<ulCount; i++) CRC32Value( CRC, *ucBuffer++ );
+ for (int i = 0; i<ulCount; i++)
+ {
+ CRC32Value( CRC, *ucBuffer++ );
+ }
return CRC;
}
