fix bug in rssi assignment

This commit is contained in:
Mark Whitehorn 2016-01-29 08:47:29 -07:00 committed by Lorenz Meier
parent 8116f15d95
commit de39b63402
1 changed files with 6 additions and 2 deletions

View File

@ -713,8 +713,12 @@ void PX4FMU::fill_rc_in(uint16_t raw_rc_count,
_rc_in.timestamp_last_signal = _rc_in.timestamp_publication;
_rc_in.rc_ppm_frame_length = 0;
/* don't touch rssi if no value was provided */
if (rssi >= 0) {
/* fake rssi if no value was provided */
if (rssi == -1) {
_rc_in.rssi =
(!frame_drop) ? RC_INPUT_RSSI_MAX : (RC_INPUT_RSSI_MAX / 2);
} else {
_rc_in.rssi = rssi;
}