mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
Sub: Set default external baro bus correctly for Pixhawk 2
This commit is contained in:
parent
a93ecb8b5a
commit
a2002180ee
@ -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 |
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user