mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 11:40:35 +08:00
sensors: check other gyros on timeout
@bkueng reviewed this and found that it is dangerous to continue on timeout because we don't update other gyro sensors in the timeout case.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2017 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2012-2018 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -630,12 +630,8 @@ Sensors::run()
|
||||
* if a gyro fails) */
|
||||
int pret = px4_poll(&poll_fds, 1, 50);
|
||||
|
||||
/* if pret == 0 it timed out - periodic check for should_exit(), etc. */
|
||||
if (pret == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* If pret == 0 it timed out but we should still do all checks and potentially copy
|
||||
* other gyros. */
|
||||
|
||||
/* this is undesirable but not much we can do - might want to flag unhappy status */
|
||||
if (pret < 0) {
|
||||
|
||||
Reference in New Issue
Block a user