go-i2c icon indicating copy to clipboard operation
go-i2c copied to clipboard

WriteRegU16LE typo

Open amurchick opened this issue 1 year ago • 1 comments

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 avatar Dec 27 '22 14:12 amurchick

Same issue also at line https://github.com/d2r2/go-i2c/blob/master/i2c.go#L231

amurchick avatar Dec 28 '22 03:12 amurchick