MaJerle / stm32f429

Keil projects and libraries for STM32F4xx devices

Home Page:https://stm32f4-discovery.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in TM_I2C_ReadMultiNoRegister

PoZitron opened this issue · comments

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?

Thanks for posting this. Will fix this.