SPI Device with cgo

master
Friedl Ulrich 10 years ago
parent ea4fca9a65
commit 610f9824a2

@ -58,11 +58,11 @@ func (r *Device) readReg(addr byte) (byte, error) {
tx[0] = addr & 0x7f
tx[1] = 0
log.Printf("read %x", addr)
err := r.SpiDevice.Xfer(tx)
rx, err := r.SpiDevice.Xfer(tx)
if err != nil {
log.Println(err)
}
return tx[1], err
return rx[1], err
}
func (r *Device) setup() error {

Loading…
Cancel
Save