硬件Crc在测试例程中可以得到跟软件Crc一致的结果,但是在令牌协议解析的时候得到不一样的结果,屏蔽硬件Crc

This commit is contained in:
Stone 2014-12-08 17:25:41 +00:00
parent 543a670da1
commit 2d34659edb
2 changed files with 4 additions and 4 deletions

View File

@ -432,7 +432,7 @@ uint TSys::Crc(const void* buf, uint len, uint crc)
}
// 硬件实现的Crc
uint TSys::Crc(const void* buf, uint len)
/*uint TSys::Crc(const void* buf, uint len)
{
#ifdef STM32F4
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);
@ -460,7 +460,7 @@ uint TSys::Crc(const void* buf, uint len)
#endif
return crc;
}
}*/
static const ushort c_CRC16Table[] =
{

4
Sys.h
View File

@ -107,8 +107,8 @@ public:
Func OnStop;
// CRC32校验
uint Crc(const void* buf, uint len);
uint Crc(const void* buf, uint len, uint crc);
//uint Crc(const void* buf, uint len);
uint Crc(const void* buf, uint len, uint crc = 0);
ushort Crc16(const void* buf, uint len, ushort crc = 0xFFFF);
// 显示十六进制数据,指定分隔字符