mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 23:33:34 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user