CRC8_8541

uint8_t Crc8_8541(uint8_t *pucData, uint8_t ucDataLen)
{
	uint8_t ucCrc = 0;
	uint8_t ucNum;
	while(ucDataLen--)
	{
		ucCrc ^= *pucData++;
		for(ucNum = 0;ucNum < 8;ucNum++)
		{
			if(ucCrc & 0x01)
			{
				ucCrc = (ucCrc >> 1) ^ 0x8c;
			}
			else
				ucCrc >>= 1;
		}
	}
	return(ucCrc); 
}
//浮點數
typedef union 
{
  struct 
  {
    unsigned char low_byte;
    unsigned char mlow_byte;
    unsigned char mhigh_byte;
    unsigned char high_byte;
  }float_byte;
          
  float  value;
}FLAOT_UNION;

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章