Skip to content

Commit

Permalink
GCS_MAVLink: bind receivers directly via AP_RCProtocol library
Browse files Browse the repository at this point in the history
... rather than via RC_Channels and the HAL and *then* to the AP_RCProtocol library...
  • Loading branch information
peterbarker committed Feb 11, 2025
1 parent 318afde commit b9a0dbc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libraries/GCS_MAVLink/GCS_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3559,7 +3559,7 @@ MAV_RESULT GCS_MAVLINK::handle_flight_termination(const mavlink_command_int_t &p
#endif
}

#if AP_RC_CHANNEL_ENABLED
#if AP_RCPROTOCOL_ENABLED
/*
handle a R/C bind request (for spektrum)
*/
Expand All @@ -3568,12 +3568,12 @@ MAV_RESULT GCS_MAVLINK::handle_START_RX_PAIR(const mavlink_command_int_t &packet
// initiate bind procedure. We accept the DSM type from either
// param1 or param2 due to a past mixup with what parameter is the
// right one
if (!RC_Channels::receiver_bind(packet.param2>0?packet.param2:packet.param1)) {
return MAV_RESULT_FAILED;
}
const int dsmMode = (packet.param2 > 0) ? packet.param2 : packet.param1;
AP::RC().start_bind(dsmMode);

return MAV_RESULT_ACCEPTED;
}
#endif // AP_RC_CHANNEL_ENABLED
#endif // AP_RCPROTOCOL_ENABLED

uint64_t GCS_MAVLINK::timesync_receive_timestamp_ns() const
{
Expand Down Expand Up @@ -5578,7 +5578,7 @@ MAV_RESULT GCS_MAVLINK::handle_command_int_packet(const mavlink_command_int_t &p
return handle_command_set_ekf_source_set(packet);
#endif

#if AP_RC_CHANNEL_ENABLED
#if AP_RCPROTOCOL_ENABLED
case MAV_CMD_START_RX_PAIR:
return handle_START_RX_PAIR(packet);
#endif
Expand Down

0 comments on commit b9a0dbc

Please sign in to comment.