Browse Source

Copter: added DEV_OPTIONS parameter

this is for little used options to allow standard firmware builds to
enable those options for development purposes

First option is for MAVLink based ADSB avoidance
master
Andrew Tridgell 9 years ago
parent
commit
d0dd10aeea
  1. 5
      ArduCopter/GCS_Mavlink.cpp
  2. 7
      ArduCopter/Parameters.cpp
  3. 3
      ArduCopter/Parameters.h
  4. 5
      ArduCopter/defines.h

5
ArduCopter/GCS_Mavlink.cpp

@ -960,7 +960,10 @@ void GCS_MAVLINK_Copter::handle_change_alt_request(AP_Mission::Mission_Command & @@ -960,7 +960,10 @@ void GCS_MAVLINK_Copter::handle_change_alt_request(AP_Mission::Mission_Command &
void GCS_MAVLINK_Copter::packetReceived(const mavlink_status_t &status,
mavlink_message_t &msg)
{
copter.avoidance_adsb.handle_msg(msg);
if (copter.g2.dev_options.get() & DevOptionADSBMAVLink) {
// optional handling of GLOBAL_POSITION_INT as a MAVLink based avoidance source
copter.avoidance_adsb.handle_msg(msg);
}
GCS_MAVLINK::packetReceived(status, msg);
}

7
ArduCopter/Parameters.cpp

@ -1000,6 +1000,13 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { @@ -1000,6 +1000,13 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @Path: ../libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp
AP_SUBGROUPINFO(afs, "AFS_", 6, ParametersG2, AP_AdvancedFailsafe),
#endif
// @Param: DEV_OPTIONS
// @DisplayName: Development options
// @Description: Bitmask of developer options. The meanings of the bit fields in this parameter may vary at any time. Developers should check the source code for current meaning
// @Bitmask: 0:ADSBMavlinkProcessing
// @User: Advanced
AP_GROUPINFO("DEV_OPTIONS", 7, ParametersG2, dev_options, 0),
AP_GROUPEND
};

3
ArduCopter/Parameters.h

@ -562,6 +562,9 @@ public: @@ -562,6 +562,9 @@ public:
// advanced failsafe library
AP_AdvancedFailsafe_Copter afs;
#endif
// developer options
AP_Int32 dev_options;
};
extern const AP_Param::Info var_info[];

5
ArduCopter/defines.h

@ -276,6 +276,11 @@ enum LandStateType { @@ -276,6 +276,11 @@ enum LandStateType {
LandStateType_Descending = 1
};
// bit options for DEV_OPTIONS parameter
enum DevOptions {
DevOptionADSBMAVLink = 1,
};
// Logging parameters
#define TYPE_AIRSTART_MSG 0x00
#define TYPE_GROUNDSTART_MSG 0x01

Loading…
Cancel
Save