mirror of https://github.com/ArduPilot/ardupilot
Sub: initialise celsius library on configured (barometer) external bus
This commit is contained in:
parent
6f7fbece49
commit
6e5e73ef2c
|
@ -19,23 +19,6 @@ void Sub::init_ardupilot()
|
|||
can_mgr.init();
|
||||
#endif
|
||||
|
||||
#if AP_FEATURE_BOARD_DETECT
|
||||
// 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);
|
||||
celsius.init(0);
|
||||
break;
|
||||
default:
|
||||
AP_Param::set_default_by_name("GND_EXT_BUS", 1);
|
||||
celsius.init(1);
|
||||
break;
|
||||
}
|
||||
#else
|
||||
AP_Param::set_default_by_name("GND_EXT_BUS", 1);
|
||||
celsius.init(1);
|
||||
#endif
|
||||
|
||||
// init cargo gripper
|
||||
#if GRIPPER_ENABLED == ENABLED
|
||||
g2.gripper.init();
|
||||
|
@ -53,6 +36,21 @@ void Sub::init_ardupilot()
|
|||
|
||||
barometer.init();
|
||||
|
||||
#if AP_FEATURE_BOARD_DETECT
|
||||
// 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
|
||||
celsius.init(barometer.external_bus());
|
||||
|
||||
// setup telem slots with serial ports
|
||||
gcs().setup_uarts();
|
||||
|
||||
|
|
Loading…
Reference in New Issue