Bug in TM_I2C_ReadMultiNoRegister
PoZitron opened this issue · comments
Дмитрий commented
Hi.
Seems you forgot to increment "data" variable in function TM_I2C_ReadMultiNoRegister. You have
while (count--) {
if (!count) {
/* Last byte */
*data = TM_I2C_ReadNack(I2Cx);
} else {
*data = TM_I2C_ReadAck(I2Cx);
}
}
but correct code is
while (count--) {
if (!count) {
/* Last byte */
*data++ = TM_I2C_ReadNack(I2Cx);
} else {
*data++ = TM_I2C_ReadAck(I2Cx);
}
}
Bug introduced in f5bac03c6023bf437a309daf449d6b956e93b6fb
Could you fix it in upstream?
Tilen Majerle commented
Thanks for posting this. Will fix this.