Skip to content
Snippets Groups Projects
Commit f537c98c authored by Dave Royer's avatar Dave Royer Committed by Daniel Agar
Browse files

ulanding radar: update driver for new 2nd gen hardware (#11035)

parent 658d7340
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment