mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
Sub: Set default external baro bus correctly for Pixhawk 2
This commit is contained in:
parent
09a640e270
commit
6265436186
@ -799,7 +799,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 |
|
||||
|
@ -32,6 +32,20 @@ void Sub::init_ardupilot()
|
||||
|
||||
BoardConfig.init();
|
||||
|
||||
#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
|
||||
|
||||
// initialise serial port
|
||||
serial_manager.init();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user