Merge pull request #12395 from boomer41/fix-i2ceepromblockdevice

Fix I2CEEBlockdevice
pull/12405/head
Martin Kojtal 2020-02-10 14:28:11 +00:00 committed by GitHub
commit 8c51f4f163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -68,7 +68,12 @@ int I2CEEBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
_i2c->stop(); _i2c->stop();
if (_i2c->read(_i2c_addr, static_cast<char *>(buffer), size) < 0) { auto err = _sync();
if (err) {
return err;
}
if (0 != _i2c->read(_i2c_addr, static_cast<char *>(buffer), size)) {
return BD_ERROR_DEVICE_ERROR; return BD_ERROR_DEVICE_ERROR;
} }