Skip to content

Commit 94ac072

Browse files
committed
fix multibyte reads (was polling wrong status value)
1 parent ab2b426 commit 94ac072

File tree

1 file changed

+1
-1
lines changed
  • libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX

1 file changed

+1
-1
lines changed

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX/i2c_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) {
138138
LPC_I2C0->MSTCTL = (1 << 0);
139139
data[count] = (LPC_I2C0->MSTDAT & 0xFF);
140140
status = ((LPC_I2C0->STAT >> 1) & (0x07));
141-
if (status != 0x00) {
141+
if (status != 0x01) {
142142
i2c_stop(obj);
143143
return count;
144144
}

0 commit comments

Comments
 (0)