platforms: nuttx px4_init fix USB serial mavlink autodetect

This commit is contained in:
Daniel Agar 2021-10-13 16:34:45 -04:00
parent f91aa76645
commit 7de00469a6
No known key found for this signature in database
GPG Key ID: FD3CBA98017A69DE
1 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ static void mavlink_usb_check(void *arg)
if (nread >= MAVLINK_HEARTBEAT_MIN_LENGTH) {
// scan buffer for mavlink HEARTBEAT (v1 & v2)
for (int i = 0; i < nread - MAVLINK_HEARTBEAT_MIN_LENGTH; i++) {
if ((buffer[i] = 0xFE) && (buffer[i + 1] = 9) && (buffer[i + 5] == 0)) {
if ((buffer[i] == 0xFE) && (buffer[i + 1] == 9) && (buffer[i + 5] == 0)) {
// mavlink v1 HEARTBEAT
// buffer[0]: start byte (0xFE for mavlink v1)
// buffer[1]: length (9 for HEARTBEAT)
@ -162,7 +162,7 @@ static void mavlink_usb_check(void *arg)
launch_mavlink = true;
break;
} else if ((buffer[i] = 0xFD) && (buffer[i + 1] = 9)
} else if ((buffer[i] == 0xFD) && (buffer[i + 1] == 9)
&& (buffer[i + 7] == 0) && (buffer[i + 8] == 0) && (buffer[i + 9] == 0)) {
// mavlink v2 HEARTBEAT
// buffer[0]: start byte (0xFD for mavlink v2)