mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 11:13:34 +08:00
only publish input_rc, if the IO RC status in ok
This commit is contained in:
committed by
Hamish Willee
parent
324b305b2d
commit
f42dbeef82
@@ -1030,7 +1030,10 @@ int PX4IO::io_publish_raw_rc()
|
|||||||
const bool rc_updated = (rc_valid_update_count != _rc_valid_update_count);
|
const bool rc_updated = (rc_valid_update_count != _rc_valid_update_count);
|
||||||
_rc_valid_update_count = rc_valid_update_count;
|
_rc_valid_update_count = rc_valid_update_count;
|
||||||
|
|
||||||
if (!rc_updated) {
|
// only publish if the IO status indicates that the RC is OK
|
||||||
|
const uint16_t status_rc_ok = _status & PX4IO_P_STATUS_FLAGS_RC_OK;
|
||||||
|
|
||||||
|
if (!rc_updated | !status_rc_ok) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user