Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/avrdude/crc16.h')
-rw-r--r--src/avrdude/crc16.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/avrdude/crc16.h b/src/avrdude/crc16.h
new file mode 100644
index 000000000..db10131de
--- /dev/null
+++ b/src/avrdude/crc16.h
@@ -0,0 +1,34 @@
+#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