mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 05:03:34 +08:00
Fixing CID 12528
This commit is contained in:
@@ -1773,12 +1773,12 @@ PX4IO::print_debug()
|
|||||||
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V2
|
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V2
|
||||||
int io_fd = -1;
|
int io_fd = -1;
|
||||||
|
|
||||||
if (io_fd < 0) {
|
if (io_fd <= 0) {
|
||||||
io_fd = ::open("/dev/ttyS0", O_RDONLY | O_NONBLOCK | O_NOCTTY);
|
io_fd = ::open("/dev/ttyS0", O_RDONLY | O_NONBLOCK | O_NOCTTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read IO's output */
|
/* read IO's output */
|
||||||
if (io_fd > 0) {
|
if (io_fd >= 0) {
|
||||||
pollfd fds[1];
|
pollfd fds[1];
|
||||||
fds[0].fd = io_fd;
|
fds[0].fd = io_fd;
|
||||||
fds[0].events = POLLIN;
|
fds[0].events = POLLIN;
|
||||||
|
|||||||
Reference in New Issue
Block a user