#include "rldf1.h"
#include <time.h>
Go to the source code of this file.
|
static unsigned short | calcCRC (unsigned short crc, unsigned short buffer) |
|
static unsigned short | computeCRC (const unsigned char *buffer, int len) |
|
#define DBGPRINTF |
( |
|
x... | ) |
|
static unsigned short calcCRC |
( |
unsigned short |
crc, |
|
|
unsigned short |
buffer |
|
) |
| |
|
static |
Definition at line 118 of file rldf1.cpp.
{
unsigned short temp1, y;
temp1 = crc ^ buffer;
crc = (crc & 0xff00) | (temp1 & 0xff);
for (y = 0; y < 8; y++) {
if (crc & 1) {
crc = crc >> 1;
crc ^= 0xa001;
} else
crc = crc >> 1;
}
return crc;
}
static unsigned short computeCRC |
( |
const unsigned char * |
buffer, |
|
|
int |
len |
|
) |
| |
|
static |
Definition at line 133 of file rldf1.cpp.
{
unsigned short crc = 0;
for (int x=0; x<len; x++) {
crc =
calcCRC(crc, (
unsigned short)buffer[x] );
}
return (crc);
}