diff --git a/cpu/kinetis_common/periph/i2c.c b/cpu/kinetis_common/periph/i2c.c index 6f6d9a8b6a54bb8d8ad727dad0aaa273c2e09954..dffdc85d01d5020bad876b626a1b48d76797033e 100644 --- a/cpu/kinetis_common/periph/i2c.c +++ b/cpu/kinetis_common/periph/i2c.c @@ -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++; }