Sub: Set default external baro bus correctly for Pixhawk 2

This commit is contained in:
Jacob Walser 2017-08-18 17:11:03 -04:00 committed by jaxxzer
parent a93ecb8b5a
commit a2002180ee
2 changed files with 14 additions and 1 deletions

View File

@ -808,7 +808,6 @@ void Sub::load_parameters(void)
convert_old_parameters();
AP_Param::set_default_by_name("BRD_SAFETYENABLE", 0);
AP_Param::set_default_by_name("GND_EXT_BUS", 1);
AP_Param::set_default_by_name("ARMING_CHECK",
AP_Arming::ARMING_CHECK_RC |
AP_Arming::ARMING_CHECK_VOLTAGE |

View File

@ -35,6 +35,20 @@ void Sub::init_ardupilot()
BoardConfig_CAN.init();
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
// Detection won't work until after BoardConfig.init()
switch (AP_BoardConfig::get_board_type()) {
case AP_BoardConfig::PX4_BOARD_PIXHAWK2:
AP_Param::set_default_by_name("GND_EXT_BUS", 0);
break;
default:
AP_Param::set_default_by_name("GND_EXT_BUS", 1);
break;
}
#else
AP_Param::set_default_by_name("GND_EXT_BUS", 1);
#endif
// identify ourselves correctly with the ground station
mavlink_system.sysid = g.sysid_this_mav;