Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in TM_I2C_ReadMultiNoRegister #9

Open
PoZitron opened this issue Apr 3, 2017 · 1 comment
Open

Bug in TM_I2C_ReadMultiNoRegister #9

PoZitron opened this issue Apr 3, 2017 · 1 comment

Comments

@PoZitron
Copy link

PoZitron commented Apr 3, 2017

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?

@MaJerle
Copy link
Owner

MaJerle commented Apr 3, 2017

Thanks for posting this. Will fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants