Skip to content

Commit

Permalink
AP_Notify: avoid use of OwnPtr for ToshibaLED
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jan 30, 2025
1 parent 51d1cee commit d5922b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_Notify/ToshibaLED_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion libraries/AP_Notify/ToshibaLED_I2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d5922b2

Please sign in to comment.