1
0
Fork 0

Merge pull request #34 from martinwag/add-custom-crc

Compiler switch enables providing own CRC16 implemetation.
This commit is contained in:
CANopenNode 2017-05-20 16:25:48 +02:00 committed by GitHub
commit 43a37e2a7f
3 changed files with 9 additions and 0 deletions

View file

@ -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 */

View file

@ -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 */

View file

@ -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,