Structural deformable models
Functions | Variables
crc Namespace Reference

Functions

void PutCRC (unsigned char b)
 

Variables

union {
   unsigned long   crc::Whole
 
   struct {
      unsigned char   crc::Data
 
      unsigned short   crc::Remainder
 
      unsigned char   crc::Head
 
   }   crc::Part
 
CRC_buffer
 

Function Documentation

void crc::PutCRC ( unsigned char  b)
inline

Definition at line 38 of file crc.h.

References CRC_buffer, and POLYNOMIAL.

Referenced by CRC().

39 {
40  using namespace crc;
41  unsigned char i;
42  CRC_buffer.Part.Data = b;
43  for (i=0; i<8; i++)
44  {
45  CRC_buffer.Whole = CRC_buffer.Whole << 1;
46  if (CRC_buffer.Part.Head & 0x01)
47  CRC_buffer.Part.Remainder ^= POLYNOMIAL;
48  }
49 }
Definition: crc.h:24
#define POLYNOMIAL
Definition: crc.h:19
union crc::@2 CRC_buffer

Variable Documentation

union { ... } crc::CRC_buffer

Referenced by CRC(), and PutCRC().

unsigned char crc::Data

Definition at line 30 of file crc.h.

unsigned char crc::Head

Definition at line 32 of file crc.h.

struct { ... } crc::Part
unsigned short crc::Remainder

Definition at line 31 of file crc.h.

unsigned long crc::Whole

Definition at line 27 of file crc.h.