mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 07:44:08 +08:00
tfmini: If the distance is 0xFFFF, a negative value is returned
This commit is contained in:
parent
274d0d65c6
commit
3b277667ff
@ -159,7 +159,11 @@ int tfmini_parse(char c, char *parserbuf, unsigned *parserbuf_index, TFMINI_PARS
|
||||
unsigned int t2 = parserbuf[3];
|
||||
t2 <<= 8;
|
||||
t2 += t1;
|
||||
*dist = ((float)t2) / 100;
|
||||
|
||||
if (t2 < 0xFFFFu) {
|
||||
*dist = ((float)t2) / 100;
|
||||
}
|
||||
|
||||
*state = TFMINI_PARSE_STATE::STATE6_GOT_CHECKSUM;
|
||||
*parserbuf_index = 0;
|
||||
ret = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user