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 committed Nov 5, 2024
1 parent 8b0d2c9 commit 77c14e7
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 77c14e7

Please sign in to comment.