mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-25 10:08:28 -04:00
AP_BattMonitor: set default I2C bus for Solo and Maxell drivers
This commit is contained in:
parent
7154d448fd
commit
e82e63e8f6
@ -114,11 +114,13 @@ AP_BattMonitor::init()
|
|||||||
break;
|
break;
|
||||||
#if HAL_BATTMON_SMBUS_ENABLE
|
#if HAL_BATTMON_SMBUS_ENABLE
|
||||||
case AP_BattMonitor_Params::BattMonitor_TYPE_SOLO:
|
case AP_BattMonitor_Params::BattMonitor_TYPE_SOLO:
|
||||||
|
_params[instance]._i2c_bus.set_default(AP_BATTMONITOR_SMBUS_BUS_INTERNAL);
|
||||||
drivers[instance] = new AP_BattMonitor_SMBus_Solo(*this, state[instance], _params[instance],
|
drivers[instance] = new AP_BattMonitor_SMBus_Solo(*this, state[instance], _params[instance],
|
||||||
hal.i2c_mgr->get_device(_params[instance]._i2c_bus, AP_BATTMONITOR_SMBUS_I2C_ADDR,
|
hal.i2c_mgr->get_device(_params[instance]._i2c_bus, AP_BATTMONITOR_SMBUS_I2C_ADDR,
|
||||||
100000, true, 20));
|
100000, true, 20));
|
||||||
break;
|
break;
|
||||||
case AP_BattMonitor_Params::BattMonitor_TYPE_MAXELL:
|
case AP_BattMonitor_Params::BattMonitor_TYPE_MAXELL:
|
||||||
|
_params[instance]._i2c_bus.set_default(AP_BATTMONITOR_SMBUS_BUS_EXTERNAL);
|
||||||
drivers[instance] = new AP_BattMonitor_SMBus_Maxell(*this, state[instance], _params[instance],
|
drivers[instance] = new AP_BattMonitor_SMBus_Maxell(*this, state[instance], _params[instance],
|
||||||
hal.i2c_mgr->get_device(_params[instance]._i2c_bus, AP_BATTMONITOR_SMBUS_I2C_ADDR,
|
hal.i2c_mgr->get_device(_params[instance]._i2c_bus, AP_BATTMONITOR_SMBUS_I2C_ADDR,
|
||||||
100000, true, 20));
|
100000, true, 20));
|
||||||
|
Loading…
Reference in New Issue
Block a user