Skip to content

Commit 0189c6f

Browse files
peterbarkertridge
authored andcommitted
AP_Notify: stop using OwnPtr in IS31FL3195
1 parent b9699b4 commit 0189c6f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

libraries/AP_Notify/IS31FL3195.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ IS31FL3195::IS31FL3195(uint8_t bus, uint8_t addr)
5454

5555
bool IS31FL3195::init(void)
5656
{
57-
_dev = std::move(hal.i2c_mgr->get_device(_bus, _addr));
57+
_dev = hal.i2c_mgr->get_device_ptr(_bus, _addr);
5858
if (!_dev) {
5959
return false;
6060
}

libraries/AP_Notify/IS31FL3195.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ class IS31FL3195 : public RGBLed
3030
{
3131
public:
3232
IS31FL3195(uint8_t bus, uint8_t addr);
33+
~IS31FL3195() { delete _dev; }
34+
3335
bool init(void) override;
3436
protected:
3537
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
3638

3739
private:
38-
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
40+
AP_HAL::I2CDevice *_dev;
3941
uint8_t _bus;
4042
uint8_t _addr;
4143

0 commit comments

Comments
 (0)