Skip to content

Commit

Permalink
AP_BattMonitor: remove use of ownptr
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Feb 4, 2025
1 parent 613aa60 commit eed3e14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion libraries/AP_BattMonitor/AP_BattMonitor_INA3221.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,11 @@ void AP_BattMonitor_INA3221::init()
}

AddressDriver *d = &address_driver[address_driver_count];
d->dev = std::move(hal.i2c_mgr->get_device(i2c_bus, i2c_address, 100000, true, 20));
d->dev = hal.i2c_mgr->get_device_ptr(i2c_bus, i2c_address, 100000, true, 20);
if (!d->dev) {
return;
}

d->bus = i2c_bus;
d->address = i2c_address;

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_BattMonitor/AP_BattMonitor_INA3221.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class AP_BattMonitor_INA3221 : public AP_BattMonitor_Backend
void timer(void);
void register_timer();

AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev;
AP_HAL::I2CDevice *dev;
uint8_t bus;
uint8_t address;
uint8_t channel_mask;
Expand Down

0 comments on commit eed3e14

Please sign in to comment.