mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #5075 from jfischer-phytec-iot/pr@kinetis-i2c
cpu/kinetis_common/periph/i2c.c: fix generating the STOP signal
This commit is contained in:
commit
0b2ffc212d
@ -261,6 +261,12 @@ static inline int _i2c_receive(I2C_Type *dev, uint8_t *data, int length)
|
||||
dev->C1 |= I2C_C1_TXAK_MASK;
|
||||
}
|
||||
|
||||
if (length == 0) {
|
||||
/* Stop immediately because the receiving of the next byte will be
|
||||
* initiated by reading the data register (dev->D). */
|
||||
dev->C1 &= ~I2C_C1_MST_MASK;
|
||||
}
|
||||
|
||||
data[n] = (char)dev->D;
|
||||
n++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user