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

WriteRegU16LE typo #20

Open
amurchick opened this issue Dec 27, 2022 · 1 comment · May be fixed by #22
Open

WriteRegU16LE typo #20

amurchick opened this issue Dec 27, 2022 · 1 comment · May be fixed by #22

Comments

@amurchick
Copy link

amurchick commented Dec 27, 2022

Please fix typo

Now in https://github.com/d2r2/go-i2c/blob/master/i2c.go#L209 was * instead of &

w := (value*0xFF00)>>8 + value<<8

Fixed line:

w := (value&0xFF00)>>8 + value<<8

But this variant more correct:

w := (value>>8)|(value<<8)
@amurchick
Copy link
Author

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

Successfully merging a pull request may close this issue.

1 participant