Sub: use enum class for ArmingMethod and ArmingRequired
This commit is contained in:
parent
5bd0db4117
commit
c48042424b
@ -562,7 +562,7 @@ MAV_RESULT GCS_MAVLINK_Sub::handle_command_long_packet(const mavlink_command_lon
|
||||
case MAV_CMD_COMPONENT_ARM_DISARM:
|
||||
if (is_equal(packet.param1,1.0f)) {
|
||||
// attempt to arm and return success or failure
|
||||
if (sub.init_arm_motors(AP_Arming::ArmingMethod::MAVLINK)) {
|
||||
if (sub.init_arm_motors(AP_Arming::Method::MAVLINK)) {
|
||||
return MAV_RESULT_ACCEPTED;
|
||||
}
|
||||
} else if (is_zero(packet.param1)) {
|
||||
|
@ -591,7 +591,7 @@ private:
|
||||
void update_surface_and_bottom_detector();
|
||||
void set_surfaced(bool at_surface);
|
||||
void set_bottomed(bool at_bottom);
|
||||
bool init_arm_motors(AP_Arming::ArmingMethod method);
|
||||
bool init_arm_motors(AP_Arming::Method method);
|
||||
void init_disarm_motors();
|
||||
void motors_output();
|
||||
Vector3f pv_location_to_vector(const Location& loc);
|
||||
|
@ -130,11 +130,11 @@ void Sub::handle_jsbutton_press(uint8_t button, bool shift, bool held)
|
||||
if (motors.armed()) {
|
||||
init_disarm_motors();
|
||||
} else {
|
||||
init_arm_motors(AP_Arming::ArmingMethod::MAVLINK);
|
||||
init_arm_motors(AP_Arming::Method::MAVLINK);
|
||||
}
|
||||
break;
|
||||
case JSButton::button_function_t::k_arm:
|
||||
init_arm_motors(AP_Arming::ArmingMethod::MAVLINK);
|
||||
init_arm_motors(AP_Arming::Method::MAVLINK);
|
||||
break;
|
||||
case JSButton::button_function_t::k_disarm:
|
||||
init_disarm_motors();
|
||||
|
@ -8,7 +8,7 @@ void Sub::enable_motor_output()
|
||||
|
||||
// init_arm_motors - performs arming process including initialisation of barometer and gyros
|
||||
// returns false if arming failed because of pre-arm checks, arming checks or a gyro calibration failure
|
||||
bool Sub::init_arm_motors(AP_Arming::ArmingMethod method)
|
||||
bool Sub::init_arm_motors(AP_Arming::Method method)
|
||||
{
|
||||
static bool in_arm_motors = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user