mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
ToshibaLED: ignore I2C errors during init
This commit is contained in:
parent
443023bbbf
commit
8f4665c4c7
@ -38,6 +38,9 @@ bool ToshibaLED_I2C::hw_init()
|
||||
return false;
|
||||
}
|
||||
|
||||
// disable recording of i2c lockup errors
|
||||
hal.i2c->ignore_errors(true);
|
||||
|
||||
// enable the led
|
||||
bool ret = (hal.i2c->writeRegister(TOSHIBA_LED_ADDRESS, TOSHIBA_LED_ENABLE, 0x03) == 0);
|
||||
|
||||
@ -46,6 +49,9 @@ bool ToshibaLED_I2C::hw_init()
|
||||
ret &= (hal.i2c->writeRegister(TOSHIBA_LED_ADDRESS, TOSHIBA_LED_PWM1, TOSHIBA_LED_OFF) == 0);
|
||||
ret &= (hal.i2c->writeRegister(TOSHIBA_LED_ADDRESS, TOSHIBA_LED_PWM2, TOSHIBA_LED_OFF) == 0);
|
||||
|
||||
// re-enable recording of i2c lockup errors
|
||||
hal.i2c->ignore_errors(false);
|
||||
|
||||
// give back i2c semaphore
|
||||
i2c_sem->give();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user