Skip to content

Commit

Permalink
CRSF bind based on rc_type 1
Browse files Browse the repository at this point in the history
  • Loading branch information
benjinne authored and hamishwillee committed Nov 14, 2024
1 parent 35fc82c commit 4a530ac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/drivers/rc/crsf_rc/CrsfRc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,15 @@ void CrsfRc::Run()
uint8_t cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_UNSUPPORTED;

if (!_is_singlewire && !_armed) {
if (BindCRSF()) {
cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED;
if ((int)vcmd.param1 == 1) {
// CRSF binding command
if (BindCRSF()) {
cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED;
}
}

} else {
cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_TEMPORARILY_REJECTED;
}

// publish acknowledgement
Expand Down

0 comments on commit 4a530ac

Please sign in to comment.