@ -28,6 +28,7 @@
@@ -28,6 +28,7 @@
# include <fcntl.h>
# include <unistd.h>
# include <drivers/drv_pwm_output.h>
# include <drivers/drv_sbus.h>
# ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
# define BOARD_PWM_COUNT_DEFAULT 2
@ -68,6 +69,12 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] PROGMEM = {
@@ -68,6 +69,12 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] PROGMEM = {
// @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 ) ,
// @Param: SBUS_OUT
// @DisplayName: Enable use of SBUS output
// @Description: Enabling this option on a Pixhawk enables SBUS servo output from the SBUS output connector
// @Values: 0:Disabled,1:Enabled
AP_GROUPINFO ( " SBUS_OUT " , 4 , AP_BoardConfig , _sbus_out_enable , 0 ) ,
# elif CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
# endif
@ -103,6 +110,16 @@ void AP_BoardConfig::init()
@@ -103,6 +110,16 @@ void AP_BoardConfig::init()
if ( _safety_enable . get ( ) = = 0 ) {
hal . rcout - > force_safety_off ( ) ;
}
if ( _sbus_out_enable . get ( ) = = 1 ) {
fd = open ( " /dev/px4io " , 0 ) ;
if ( fd = = - 1 | | ioctl ( fd , SBUS_SET_PROTO_VERSION , 1 ) ! = 0 ) {
hal . console - > printf ( " SBUS: Unable to setup SBUS output \n " ) ;
}
if ( fd ! = - 1 ) {
close ( fd ) ;
}
}
# elif CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
/* configure the VRBRAIN driver for the right number of PWMs */