Only publish RC inputs if we have seen some valid inputs at some point

This commit is contained in:
Lorenz Meier 2014-04-05 10:28:01 +02:00
parent c6d98a32f8
commit 64ffafb48e
1 changed files with 5 additions and 3 deletions

View File

@ -1479,9 +1479,11 @@ PX4IO::io_publish_raw_rc()
} else {
rc_val.input_source = RC_INPUT_SOURCE_UNKNOWN;
/* we do not know the RC input, but have to publish timestamp_published
* and rc_lost flag, so do not prematurely return here
*/
/* only keep publishing RC input if we ever got a valid input */
if (_rc_last_valid == 0) {
/* we have never seen valid RC signals, abort */
return OK;
}
}
/* lazily advertise on first publication */