From 610f9824a2e16e1227c668429f30ad0f26740d57 Mon Sep 17 00:00:00 2001 From: Friedl Ulrich Date: Thu, 5 Feb 2015 22:00:39 +0100 Subject: [PATCH] SPI Device with cgo --- rfm69device.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rfm69device.go b/rfm69device.go index 557635d..d23da8e 100644 --- a/rfm69device.go +++ b/rfm69device.go @@ -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 {