mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 21:43:33 +08:00
CRC fix
This commit is contained in:
@@ -26,14 +26,14 @@ public:
|
|||||||
: value_(0x0000)
|
: value_(0x0000)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
Crc16(const uint8_t* bytes, int len)
|
Crc16(const uint8_t* bytes, unsigned int len)
|
||||||
: value_(0x0000)
|
: value_(0x0000)
|
||||||
{
|
{
|
||||||
add(bytes, len);
|
add(bytes, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t add(uint8_t byte);
|
uint16_t add(uint8_t byte);
|
||||||
uint16_t add(const uint8_t* bytes, int len);
|
uint16_t add(const uint8_t* bytes, unsigned int len);
|
||||||
|
|
||||||
uint16_t get() const { return value_; }
|
uint16_t get() const { return value_; }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ uint16_t Crc16::add(uint8_t byte)
|
|||||||
return value_;
|
return value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Crc16::add(const uint8_t* bytes, int len)
|
uint16_t Crc16::add(const uint8_t* bytes, unsigned int len)
|
||||||
{
|
{
|
||||||
assert(bytes);
|
assert(bytes);
|
||||||
while (len--)
|
while (len--)
|
||||||
|
|||||||
Reference in New Issue
Block a user