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
This commit is contained in:
Andrew Tridgell 2016-09-12 16:23:53 +10:00
parent 9b83781b4f
commit d0dd10aeea
4 changed files with 19 additions and 1 deletions

View File

@ -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);
}

View File

@ -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
};

View File

@ -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[];

View File

@ -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