ToshibaLED: ignore I2C errors during init

This commit is contained in:
Randy Mackay 2013-10-21 17:27:34 +09:00
parent 443023bbbf
commit 8f4665c4c7

View File

@ -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();