Skip to content
Snippets Groups Projects
Commit 8f4665c4 authored by Randy Mackay's avatar Randy Mackay
Browse files

ToshibaLED: ignore I2C errors during init

parent 443023bb
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment