mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
ulanding radar: update driver for new 2nd gen hardware (#11035)
This commit is contained in:
@@ -360,8 +360,11 @@ bool Radar::read_and_parse(uint8_t *buf, int len, float *range)
|
||||
if (is_header_byte(_buf[index])) {
|
||||
if (no_header_counter >= BUF_LEN / 3 - 1) {
|
||||
if (ULANDING_VERSION == 1) {
|
||||
if (((_buf[index + 1] + _buf[index + 2] + _buf[index + 3] + _buf[index + 4])) != (_buf[index + 5])
|
||||
|| (_buf[index + 1] <= 0)) {
|
||||
bool checksum_passed = (((_buf[index + 1] + _buf[index + 2] + _buf[index + 3] + _buf[index + 4]) & 0xFF) == _buf[index +
|
||||
5]);
|
||||
|
||||
if (!checksum_passed) {
|
||||
// checksum failed
|
||||
ret = false;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user