Merge pull request #34 from martinwag/add-custom-crc
Compiler switch enables providing own CRC16 implemetation.
This commit is contained in:
commit
43a37e2a7f
3 changed files with 9 additions and 0 deletions
|
|
@ -52,6 +52,9 @@
|
|||
be generated with calloc(). */
|
||||
/* #define CO_USE_GLOBALS */
|
||||
|
||||
/* If defined, the user provides an own implemetation for calculating the
|
||||
* CRC16 CCITT checksum. */
|
||||
/* #define CO_USE_OWN_CRC16 */
|
||||
|
||||
#ifndef CO_USE_GLOBALS
|
||||
#include <stdlib.h> /* for malloc, free */
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
* to do so, delete this exception statement from your version.
|
||||
*/
|
||||
|
||||
#ifndef CO_USE_OWN_CRC16
|
||||
|
||||
#include "crc16-ccitt.h"
|
||||
|
||||
|
|
@ -114,3 +115,5 @@ unsigned short crc16_ccitt(
|
|||
}
|
||||
return crc;
|
||||
}
|
||||
|
||||
#endif /* CO_USE_OWN_CRC16 */
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@
|
|||
*
|
||||
* @return Calculated CRC.
|
||||
*/
|
||||
#ifdef CO_USE_OWN_CRC16
|
||||
extern
|
||||
#endif
|
||||
unsigned short crc16_ccitt(
|
||||
const unsigned char block[],
|
||||
unsigned int blockLength,
|
||||
|
|
|
|||
Loading…
Reference in a new issue