summaryrefslogtreecommitdiff
path: root/arm9/lib/include/MATH_crc.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/lib/include/MATH_crc.h')
-rw-r--r--arm9/lib/include/MATH_crc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arm9/lib/include/MATH_crc.h b/arm9/lib/include/MATH_crc.h
index f15a2e32..4f06fa75 100644
--- a/arm9/lib/include/MATH_crc.h
+++ b/arm9/lib/include/MATH_crc.h
@@ -7,6 +7,8 @@ typedef u8 MATHCRC8Context;
typedef u16 MATHCRC16Context;
typedef u32 MATHCRC32Context;
+#define MATH_CRC16_CCITT_POLY 0x1021
+
struct MATHCRC8Table {
u8 table[256];
};
@@ -35,4 +37,9 @@ void MATHi_CRC16InitTable(struct MATHCRC16Table *table, u16 poly);
void MATHi_CRC8Update(const struct MATHCRC8Table *table, MATHCRC8Context *context, const void *input, u32 length);
void MATHi_CRC8InitTable(struct MATHCRC8Table *table, u8 poly);
+static inline void MATH_CRC16InitTable(struct MATHCRC16Table * table)
+{
+ MATHi_CRC16InitTable(table, MATH_CRC16_CCITT_POLY);
+}
+
#endif