stianeikeland / go-rpio

:electric_plug: Raspberry Pi GPIO library for go-lang
MIT License
2.2k stars 221 forks source link

Error in ReadPin for higher pins. #14

Closed drahoslove closed 6 years ago

drahoslove commented 7 years ago

https://github.com/stianeikeland/go-rpio/blob/896db2ee1c7f95240dd6a09e56edf9cece107a34/rpio.go#L214 I know, that it does not matter much because pins with the number higher than 31 are not really accessible on board. But for consistency with WritePin, I think it should be fixed to: if (mem[levelReg] & (1 << uint8(pin & 31))) != 0 {

drahoslove commented 6 years ago

fixed by merging #15