Sub: use BARO instead of GND prefix to set default baro parameters

This updates the code to deal with the changes from 3f6fd49507
This commit is contained in:
Willian Galvani 2021-07-12 16:37:59 -03:00 committed by Andrew Tridgell
parent 5f039ba06d
commit da906f6b0f

View File

@ -40,17 +40,17 @@ void Sub::init_ardupilot()
// Detection won't work until after BoardConfig.init() // Detection won't work until after BoardConfig.init()
switch (AP_BoardConfig::get_board_type()) { switch (AP_BoardConfig::get_board_type()) {
case AP_BoardConfig::PX4_BOARD_PIXHAWK2: case AP_BoardConfig::PX4_BOARD_PIXHAWK2:
AP_Param::set_default_by_name("GND_EXT_BUS", 0); AP_Param::set_default_by_name("BARO_EXT_BUS", 0);
break; break;
case AP_BoardConfig::PX4_BOARD_PIXHAWK: case AP_BoardConfig::PX4_BOARD_PIXHAWK:
AP_Param::set_by_name("GND_EXT_BUS", 1); AP_Param::set_by_name("BARO_EXT_BUS", 1);
break; break;
default: default:
AP_Param::set_default_by_name("GND_EXT_BUS", 1); AP_Param::set_default_by_name("BARO_EXT_BUS", 1);
break; break;
} }
#else #else
AP_Param::set_default_by_name("GND_EXT_BUS", 1); AP_Param::set_default_by_name("BARO_EXT_BUS", 1);
#endif #endif
celsius.init(barometer.external_bus()); celsius.init(barometer.external_bus());