Skip to content

Commit 8c51f4f

Browse files
authored
Merge pull request ARMmbed#12395 from boomer41/fix-i2ceepromblockdevice
Fix I2CEEBlockdevice
2 parents a8e8723 + d7f3fcc commit 8c51f4f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ int I2CEEBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
6868

6969
_i2c->stop();
7070

71-
if (_i2c->read(_i2c_addr, static_cast<char *>(buffer), size) < 0) {
71+
auto err = _sync();
72+
if (err) {
73+
return err;
74+
}
75+
76+
if (0 != _i2c->read(_i2c_addr, static_cast<char *>(buffer), size)) {
7277
return BD_ERROR_DEVICE_ERROR;
7378
}
7479

0 commit comments

Comments
 (0)