ingenialink/ecat/net.c
static void init_crcccitt_tab_ecat(void) {

	uint16_t i;
	uint16_t j;
	uint16_t crc;
	uint16_t c;

	for (i = 0; i<256; i++) {
		crc = 0;
		c = i << 8;
		for (j = 0; j<8; j++) {
			if ((crc ^ c) & 0x8000) crc = (crc << 1) ^ 0x1021;
			else crc = crc << 1;
			c = c << 1;
		}
		crc_tabccitt_ecat[i] = crc;
	}
	crc_tabccitt_init_ecat = true;
}
/**
* Compute CRC of the given buffer.
*
* @param [in] buf
*	Buffer.
* @param [in] sz
*	Buffer size (bytes).
*
* @return
*	CRC.
*/
Compute CRC of the given buffer.
Compute CRC of the given buffer .
static void init_crcccitt_tab_ecat(void) {
	uint16_t i;
	uint16_t j;
	uint16_t crc;
	uint16_t c;
	for (i = 0; i<256; i++) {
		crc = 0;
		c = i << 8;
		for (j = 0; j<8; j++) {
			if ((crc ^ c) & 0x8000) crc = (crc << 1) ^ 0x1021;
			else crc = crc << 1;
			c = c << 1;
		}
		crc_tabccitt_ecat[i] = crc;
	}
	crc_tabccitt_init_ecat = true;
}
static void init_crcccitt_tab_ecat ( void ) { uint16_t i ; uint16_t j ; uint16_t crc ; uint16_t c ; for ( i = 0 ; i < 256 ; i ++ ) { crc = 0 ; c = i << 8 ; for ( j = 0 ; j < 8 ; j ++ ) { if ( ( crc ^ c ) & 0x8000 ) crc = ( crc << 1 ) ^ 0x1021 ; else crc = crc << 1 ; c = c << 1 ; } crc_tabccitt_ecat [ i ] = crc ; } crc_tabccitt_init_ecat = true ; }
Compute CRC of the given buffer.
Compute CRC of the given buffer .