diff --git a/msg/versioned/VehicleCommand.msg b/msg/versioned/VehicleCommand.msg index 96162e9f89f9..3a0c26bc42d0 100644 --- a/msg/versioned/VehicleCommand.msg +++ b/msg/versioned/VehicleCommand.msg @@ -169,6 +169,13 @@ uint8 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3 uint8 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4 uint8 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5 +# used as param1&2 in CMD_START_RX_PAIR +uint8 RC_TYPE_SPEKTRUM = 0 +uint8 RC_TYPE_CRSF = 1 +uint8 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0 +uint8 RC_SUB_TYPE_SPEKTRUM_DSMX = 1 +uint8 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2 + # used as param1 in ARM_DISARM command int8 ARMING_ACTION_DISARM = 0 int8 ARMING_ACTION_ARM = 1 diff --git a/src/drivers/rc/crsf_rc/CrsfRc.cpp b/src/drivers/rc/crsf_rc/CrsfRc.cpp index b68a7149ca29..080bba7c7abe 100644 --- a/src/drivers/rc/crsf_rc/CrsfRc.cpp +++ b/src/drivers/rc/crsf_rc/CrsfRc.cpp @@ -195,7 +195,7 @@ void CrsfRc::Run() uint8_t cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_UNSUPPORTED; if (!_is_singlewire && !_armed) { - if ((int)vcmd.param1 == 1) { + if ((int)vcmd.param1 == vehicle_command_s::RC_TYPE_CRSF) { // CRSF binding command if (BindCRSF()) { cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED; diff --git a/src/drivers/rc_input/RCInput.cpp b/src/drivers/rc_input/RCInput.cpp index 12cd1ab0bf40..83eeb99b0b1c 100644 --- a/src/drivers/rc_input/RCInput.cpp +++ b/src/drivers/rc_input/RCInput.cpp @@ -374,19 +374,19 @@ void RCInput::Run() #if defined(SPEKTRUM_POWER) if (!_rc_scan_locked && !_armed) { - if ((int)vcmd.param1 == 0) { + if ((int)vcmd.param1 == vehicle_command_s::RC_TYPE_SPEKTRUM) { // DSM binding command int dsm_bind_mode = (int)vcmd.param2; int dsm_bind_pulses = 0; - if (dsm_bind_mode == 0) { + if (dsm_bind_mode == vehicle_command_s::RC_SUB_TYPE_SPEKTRUM_DSM2) { dsm_bind_pulses = DSM2_BIND_PULSES; - } else if (dsm_bind_mode == 1) { + } else if (dsm_bind_mode == vehicle_command_s::RC_SUB_TYPE_SPEKTRUM_DSMX) { dsm_bind_pulses = DSMX_BIND_PULSES; - } else { + } else if (dsm_bind_mode == vehicle_command_s::RC_SUB_TYPE_SPEKTRUM_DSMX8) { dsm_bind_pulses = DSMX8_BIND_PULSES; }