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.
Diff: CRC16_CCITT.h
- Revision:
- 1:6ecc3a64bf7b
- Parent:
- 0:253105d48c3c
--- a/CRC16_CCITT.h Sat Sep 02 08:26:22 2017 +0000
+++ b/CRC16_CCITT.h Sun Sep 03 08:29:38 2017 +0000
@@ -4,7 +4,7 @@
*
* Modified by Zoltan Hudak to implement CRC16-CCITT
* using the polynomial 0x1021: X^16 + X^15 + X^2 + 1.
- * Initial CRC register = 0x0000
+ * Default initial CRC value = 0x0000
*/
#ifndef CRC16_CCITT_H
@@ -16,8 +16,9 @@
static const unsigned int SHIFTER;
static const unsigned short TABLE[];
public:
- CRC16_CCITT(void) { };
- ~CRC16_CCITT(void){ };
- unsigned short calc(char input[], int length);
+ CRC16_CCITT(void){};
+ ~CRC16_CCITT(void){};
+ unsigned short calc(char input[], int length, unsigned short crc = 0x0000);
};
+
#endif // CRC16_CCITT_H