mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-13 21:01:36 +08:00
POSIX: disable UART in mavlink
Most of the current POSIX builds will not use the UART and it is just a unnecessary dependency to satisfy when running in a test environment. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
#include <time.h>
|
||||
#include <float.h>
|
||||
#include <unistd.h>
|
||||
#ifndef __PX4_QURT
|
||||
#ifndef __PX4_POSIX
|
||||
#include <sys/prctl.h>
|
||||
#include <termios.h>
|
||||
#endif
|
||||
@@ -1480,7 +1480,7 @@ MavlinkReceiver::handle_message_hil_state_quaternion(mavlink_message_t *msg)
|
||||
void *
|
||||
MavlinkReceiver::receive_thread(void *arg)
|
||||
{
|
||||
#ifndef __PX4_QURT
|
||||
#ifndef __PX4_POSIX
|
||||
int uart_fd = _mavlink->get_uart_fd();
|
||||
|
||||
const int timeout = 500;
|
||||
@@ -1570,7 +1570,7 @@ MavlinkReceiver::receive_start(Mavlink *parent)
|
||||
pthread_attr_t receiveloop_attr;
|
||||
pthread_attr_init(&receiveloop_attr);
|
||||
|
||||
#ifndef __PX4_QURT
|
||||
#ifndef __PX4_POSIX
|
||||
// set to non-blocking read
|
||||
int flags = fcntl(parent->get_uart_fd(), F_GETFL, 0);
|
||||
fcntl(parent->get_uart_fd(), F_SETFL, flags | O_NONBLOCK);
|
||||
|
||||
Reference in New Issue
Block a user