fix multibyte reads (was polling wrong status value)

pull/294/head
mazgch 2014-05-07 13:39:27 +02:00
parent ab2b426832
commit 94ac072267
1 changed files with 1 additions and 1 deletions

View File

@ -138,7 +138,7 @@ int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) {
LPC_I2C0->MSTCTL = (1 << 0);
data[count] = (LPC_I2C0->MSTDAT & 0xFF);
status = ((LPC_I2C0->STAT >> 1) & (0x07));
if (status != 0x00) {
if (status != 0x01) {
i2c_stop(obj);
return count;
}