AP_BoardConfig: Add safety option off

This commit is contained in:
Michael du Breuil 2019-01-07 17:18:46 -07:00 committed by Andrew Tridgell
parent 8638446c36
commit ba49e9e17c
2 changed files with 5 additions and 4 deletions

View File

@ -221,7 +221,7 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
// @Param: SAFETYOPTION
// @DisplayName: Options for safety button behavior
// @Description: This controls the activation of the safety button. It allows you to control if the safety button can be used for safety enable and/or disable, and whether the button is only active when disarmed
// @Bitmask: 0:ActiveForSafetyEnable,1:ActiveForSafetyDisable,2:ActiveWhenArmed
// @Bitmask: 0:ActiveForSafetyEnable,1:ActiveForSafetyDisable,2:ActiveWhenArmed,3:Force safety on when the aircraft disarms
// @User: Standard
AP_GROUPINFO("SAFETYOPTION", 13, AP_BoardConfig, state.safety_option, BOARD_SAFETY_OPTION_DEFAULT),
#endif

View File

@ -123,9 +123,10 @@ public:
#if HAL_HAVE_SAFETY_SWITCH
enum board_safety_button_option {
BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_OFF=1,
BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_ON=2,
BOARD_SAFETY_OPTION_BUTTON_ACTIVE_ARMED=4,
BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_OFF= (1 << 0),
BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_ON= (1 << 1),
BOARD_SAFETY_OPTION_BUTTON_ACTIVE_ARMED= (1 << 2),
BOARD_SAFETY_OPTION_SAFETY_ON_DISARM= (1 << 3),
};
// return safety button options. Bits are in enum board_safety_button_option