/* #define DEBUG_CRC */
-static void makeCRCtable(unsigned long *table, unsigned long id)
+static void makeCRCtable(unsigned int *table, unsigned int id)
{
- unsigned long i, j, k;
+ unsigned int i, j, k;
for(i = 0; i < 256; ++i) {
k = i;
}
}
-unsigned long getCRC(volatile unsigned short *mem, signed long count,
+static unsigned int table[256];
+
+unsigned int getCRC(volatile unsigned short *mem, signed long count,
volatile unsigned short *crcH, volatile unsigned short *crcL)
{
unsigned char mem0, mem1;
int i;
- unsigned long CRC = 0;
-#ifndef DEBUG_CRC
- unsigned long table[256];
-#else
- unsigned long table[256] = {
+ unsigned int CRC = 0;
+#ifdef DEBUG_CRC
+ unsigned int table[256] = {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
#define CRC32_H
/* unit of count is 2byte */
-unsigned long getCRC(volatile unsigned short *mem, signed long count,
+unsigned int getCRC(volatile unsigned short *mem, signed long count,
volatile unsigned short *crcH, volatile unsigned short *crcL);
#endif