mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-13 09:24:55 +00:00
- Make all internal functions "static". - Make sure each module's header and implementation file match. - Remove all library-like functionality from main.c, so only the actual frontend remains in main.c. - Add C++ brackets to all header files. That effectively leaves the various module C files as something like an "avrdude library", with main.c being the currently only frontend program for that library. In theory, it should be possible to write different frontends using the same library backend functions though. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@722 81a1dc3b-b13d-400b-aceb-764788c761c2
35 lines
753 B
C
35 lines
753 B
C
#ifndef CRC16_H
|
|
#define CRC16_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
* Derived from CRC algorithm for JTAG ICE mkII, published in Atmel
|
|
* Appnote AVR067. Converted from C++ to C.
|
|
*/
|
|
|
|
extern unsigned short crcsum(const unsigned char* message,
|
|
unsigned long length,
|
|
unsigned short crc);
|
|
/*
|
|
* Verify that the last two bytes is a (LSB first) valid CRC of the
|
|
* message.
|
|
*/
|
|
extern int crcverify(const unsigned char* message,
|
|
unsigned long length);
|
|
/*
|
|
* Append a two byte CRC (LSB first) to message. length is size of
|
|
* message excluding crc. Space for the CRC bytes must be allocated
|
|
* in advance!
|
|
*/
|
|
extern void crcappend(unsigned char* message,
|
|
unsigned long length);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|