Skip to content

Commit

Permalink
crsf_rc: bind feature fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
benjinne committed Nov 4, 2024
1 parent 4b5738b commit 8b0d2c9
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/drivers/rc/crsf_rc/CrsfRc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ void CrsfRc::Run()
uint8_t cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_UNSUPPORTED;

if (!_is_singlewire && !_armed) {
if(BindCRSF())
{
if (BindCRSF()) {
cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED;
}
}
Expand Down Expand Up @@ -513,17 +512,17 @@ bool CrsfRc::SendTelemetryFlightMode(const char *flight_mode)

bool CrsfRc::BindCRSF()
{
uint8_t bindFrame[] = {
(uint8_t)crsf_sync_t::sync,
0x07, // frame length
(uint8_t)crsf_frame_type_t::command,
(uint8_t)crsf_address_t::crsf_receiver,
(uint8_t)crsf_address_t::flight_controller,
(uint8_t)crsf_sub_command_t::subcmd_rx,
(uint8_t)crsf_sub_command_t::subcmd_rx_bind,
0x9E, // Command CRC8
0xE8, // Packet CRC8
};
uint8_t bindFrame[] = {
(uint8_t)crsf_sync_t::sync,
0x07, // frame length
(uint8_t)crsf_frame_type_t::command,
(uint8_t)crsf_address_t::crsf_receiver,
(uint8_t)crsf_address_t::flight_controller,
(uint8_t)crsf_sub_command_t::subcmd_rx,
(uint8_t)crsf_sub_command_t::subcmd_rx_bind,
0x9E, // Command CRC8
0xE8, // Packet CRC8
};

return _uart->write((void *) bindFrame, 9);
}
Expand Down

0 comments on commit 8b0d2c9

Please sign in to comment.