Browse Source

Copter: correct GuidedOptions enum after peer review

Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>
zr-v5.1
Randy Mackay 4 years ago
parent
commit
9104b4800f
  1. 4
      ArduCopter/Parameters.cpp
  2. 5
      ArduCopter/mode.h
  3. 2
      ArduCopter/mode_guided.cpp

4
ArduCopter/Parameters.cpp

@ -986,12 +986,12 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { @@ -986,12 +986,12 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
#endif
#if MODE_GUIDED_ENABLED == ENABLED
// @Param: GUIDED_OPTIONS
// @Param: GUID_OPTIONS
// @DisplayName: Guided mode options
// @Description: Options that can be applied to change guided mode behaviour
// @Bitmask: 0:Allow Arming from Transmitter
// @User: Advanced
AP_GROUPINFO("GUIDED_OPTIONS", 41, ParametersG2, guided_options, 0),
AP_GROUPINFO("GUID_OPTIONS", 41, ParametersG2, guided_options, 0),
#endif
AP_GROUPEND

5
ArduCopter/mode.h

@ -833,9 +833,9 @@ protected: @@ -833,9 +833,9 @@ protected:
private:
// enum for GUIDED_OPTIONS parameter
// enum for GUID_OPTIONS parameter
enum class Options : int32_t {
AllowArmingFromTX = (1 << 0U),
AllowArmingFromTX = (1U << 0),
};
void pos_control_start();
@ -865,7 +865,6 @@ public: @@ -865,7 +865,6 @@ public:
bool requires_GPS() const override { return false; }
bool has_manual_throttle() const override { return false; }
bool allows_arming(bool from_gcs) const override { return from_gcs; }
bool is_autopilot() const override { return true; }
protected:

2
ArduCopter/mode_guided.cpp

@ -89,7 +89,7 @@ bool ModeGuided::allows_arming(bool from_gcs) const @@ -89,7 +89,7 @@ bool ModeGuided::allows_arming(bool from_gcs) const
}
// optionally allow arming from the transmitter
return (copter.g2.guided_options & (int32_t)Options::AllowArmingFromTX) != 0;
return (copter.g2.guided_options & (uint32_t)Options::AllowArmingFromTX) != 0;
};
// do_user_takeoff_start - initialises waypoint controller to implement take-off

Loading…
Cancel
Save