mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-07 16:33:58 -04:00
AP_Notify: avoid use of OwnPtr for ToshibaLED
This commit is contained in:
parent
51d1cee5eb
commit
d5922b2cf1
@ -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;
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user