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();
|
can_mgr.init();
|
||||||
#endif
|
#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
|
// init cargo gripper
|
||||||
#if GRIPPER_ENABLED == ENABLED
|
#if GRIPPER_ENABLED == ENABLED
|
||||||
g2.gripper.init();
|
g2.gripper.init();
|
||||||
|
@ -53,6 +36,21 @@ void Sub::init_ardupilot()
|
||||||
|
|
||||||
barometer.init();
|
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
|
// setup telem slots with serial ports
|
||||||
gcs().setup_uarts();
|
gcs().setup_uarts();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue