AP_BoardConfig: added BRD_SAFETYENABLE option

this allows the safety switch to be disabled on startup
This commit is contained in:
Andrew Tridgell 2014-02-11 15:58:02 +11:00
parent 439a075b30
commit 8095eb0bee
2 changed files with 11 additions and 0 deletions

View File

@ -60,6 +60,12 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] PROGMEM = {
// @Description: Enable flow control on serial 2 (telemetry 2) on Pixhawk and PX4. You must have the RTS and CTS pins connected to your radio. The standard DF13 6 pin connector for a 3DR radio does have those pins connected. If this is set to 2 then flow control will be auto-detected by checking for the output buffer filling on startup. // @Description: Enable flow control on serial 2 (telemetry 2) on Pixhawk and PX4. You must have the RTS and CTS pins connected to your radio. The standard DF13 6 pin connector for a 3DR radio does have those pins connected. If this is set to 2 then flow control will be auto-detected by checking for the output buffer filling on startup.
// @Values: 0:Disabled,1:Enabled,2:Auto // @Values: 0:Disabled,1:Enabled,2:Auto
AP_GROUPINFO("SER2_RTSCTS", 2, AP_BoardConfig, _ser2_rtscts, 2), AP_GROUPINFO("SER2_RTSCTS", 2, AP_BoardConfig, _ser2_rtscts, 2),
// @Param: SAFETYENABLE
// @DisplayName: Enable use of safety arming switch
// @Description: Disabling this option will disable the use of the safety switch on PX4 for arming. Use of the safety switch is highly recommended, so you should leave this option set to 1 except in unusual circumstances.
// @Values: 0:Disabled,1:Enabled
AP_GROUPINFO("SAFETYENABLE", 3, AP_BoardConfig, _safety_enable, 1),
#endif #endif
AP_GROUPEND AP_GROUPEND
@ -90,5 +96,9 @@ void AP_BoardConfig::init()
if (hal.uartD != NULL) { if (hal.uartD != NULL) {
hal.uartD->set_flow_control((AP_HAL::UARTDriver::flow_control)_ser2_rtscts.get()); hal.uartD->set_flow_control((AP_HAL::UARTDriver::flow_control)_ser2_rtscts.get());
} }
if (_safety_enable.get() == 0) {
hal.rcout->force_safety_off();
}
#endif #endif
} }

View File

@ -25,6 +25,7 @@ private:
AP_Int8 _pwm_count; AP_Int8 _pwm_count;
AP_Int8 _ser1_rtscts; AP_Int8 _ser1_rtscts;
AP_Int8 _ser2_rtscts; AP_Int8 _ser2_rtscts;
AP_Int8 _safety_enable;
#endif #endif
}; };