The goal of this patch is to allow compatibility with GR12/GR16/GR24 graupner receiver by :

- allowing decoding of SUMD frame with failsafe bit set
- updating stack failsafe state with the sumd failsafe info

Refer to #5817 issue
This commit is contained in:
Benoit3
2016-11-12 14:28:57 +01:00
committed by Lorenz Meier
parent 697d401b73
commit 83e9e1c382
5 changed files with 22 additions and 9 deletions
+9 -2
View File
@@ -125,6 +125,7 @@ bool dsm_port_input(uint16_t *rssi, bool *dsm_updated, bool *st24_updated, bool
/* get data from FD and attempt to parse with SUMD libs */
uint8_t sumd_rssi, sumd_rx_count;
uint16_t sumd_channel_count = 0;
bool sumd_failsafe_state;
*sumd_updated = false;
@@ -132,7 +133,7 @@ bool dsm_port_input(uint16_t *rssi, bool *dsm_updated, bool *st24_updated, bool
/* set updated flag if one complete packet was parsed */
sumd_rssi = RC_INPUT_RSSI_MAX;
*sumd_updated |= (OK == sumd_decode(bytes[i], &sumd_rssi, &sumd_rx_count,
&sumd_channel_count, r_raw_rc_values, PX4IO_RC_INPUT_CHANNELS));
&sumd_channel_count, r_raw_rc_values, PX4IO_RC_INPUT_CHANNELS, &sumd_failsafe_state));
}
if (*sumd_updated) {
@@ -142,7 +143,13 @@ bool dsm_port_input(uint16_t *rssi, bool *dsm_updated, bool *st24_updated, bool
r_status_flags |= PX4IO_P_STATUS_FLAGS_RC_SUMD;
r_raw_rc_flags &= ~(PX4IO_P_RAW_RC_FLAGS_FRAME_DROP);
r_raw_rc_flags &= ~(PX4IO_P_RAW_RC_FLAGS_FAILSAFE);
if (sumd_failsafe_state) {
r_raw_rc_flags |= (PX4IO_P_RAW_RC_FLAGS_FAILSAFE);
} else {
r_raw_rc_flags &= ~(PX4IO_P_RAW_RC_FLAGS_FAILSAFE);
}
}
return (*dsm_updated | *st24_updated | *sumd_updated);