mirror of https://github.com/ARMmbed/mbed-os.git
commit
eed91bce3b
|
@ -351,6 +351,13 @@ int i2c_slave_read(i2c_t *obj, char *data, int length) {
|
|||
} while (((status == 0x80) || (status == 0x90) ||
|
||||
(status == 0x060) || (status == 0x70)) && (count < length));
|
||||
|
||||
// Clear old status and wait for Serial Interrupt.
|
||||
i2c_clear_SI(obj);
|
||||
i2c_wait_SI(obj);
|
||||
|
||||
// Obtain new status.
|
||||
status = i2c_status(obj);
|
||||
|
||||
if(status != 0xA0) {
|
||||
i2c_stop(obj);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue