AP_Notify: avoid use of OwnPtr for ToshibaLED

This commit is contained in:
Peter Barker 2025-01-29 10:24:45 +11:00 committed by Peter Barker
parent 51d1cee5eb
commit d5922b2cf1
2 changed files with 3 additions and 2 deletions

View File

@ -49,7 +49,7 @@ ToshibaLED_I2C::ToshibaLED_I2C(uint8_t bus)
bool ToshibaLED_I2C::init(void)
{
// first look for led on external bus
_dev = std::move(hal.i2c_mgr->get_device(_bus, TOSHIBA_LED_I2C_ADDR));
_dev = hal.i2c_mgr->get_device_ptr(_bus, TOSHIBA_LED_I2C_ADDR);
if (!_dev) {
return false;
}

View File

@ -27,12 +27,13 @@ class ToshibaLED_I2C : public RGBLed
{
public:
ToshibaLED_I2C(uint8_t bus);
~ToshibaLED_I2C() { delete _dev; }
bool init(void) override;
protected:
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
private:
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
AP_HAL::I2CDevice *_dev;
void _timer(void);
bool _need_update;
struct {