mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
fix build on windows
This commit is contained in:
parent
f7bbd7f4c7
commit
ec0a654d7c
@ -109,7 +109,7 @@ static const uint8_t table_crc_lo[] = {
|
||||
0x88, 0x48, 0x49, 0x89, 0x4B, 0x8B, 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C,
|
||||
0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83, 0x41, 0x81, 0x80, 0x40};
|
||||
|
||||
uint16_t tkc_crc16_modbus(const uint8_t* data, uint32_t len) {
|
||||
uint16_t tk_crc16_modbus(const uint8_t* data, uint32_t len) {
|
||||
unsigned int i = 0;
|
||||
uint8_t crc_hi = 0xFF;
|
||||
uint8_t crc_lo = 0xFF;
|
||||
|
@ -96,7 +96,7 @@ uint16_t tk_crc16_byte(uint16_t crc, uint8_t data);
|
||||
*
|
||||
* @return {uint16_t} 返回计算结果。
|
||||
*/
|
||||
uint16_t tkc_crc16_modbus(const uint8_t* data, uint32_t len);
|
||||
uint16_t tk_crc16_modbus(const uint8_t* data, uint32_t len);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -7,5 +7,5 @@ TEST(crc, crc32_file) {
|
||||
|
||||
TEST(crc, crc32_modbus) {
|
||||
uint8_t data[] = {0x11, 0x05, 0x01, 0x30, 0xff, 0x00};
|
||||
ASSERT_EQ(tkc_crc16_modbus(data, sizeof(data)), 0x598f);
|
||||
ASSERT_EQ(tk_crc16_modbus(data, sizeof(data)), 0x598f);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user