From ea4fca9a650f6ead1a8597031759e560e44d0972 Mon Sep 17 00:00:00 2001 From: Friedl Ulrich Date: Thu, 5 Feb 2015 21:59:36 +0100 Subject: [PATCH] SPI Device with cgo --- rfm69spi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfm69spi.go b/rfm69spi.go index c24333d..5ba279e 100644 --- a/rfm69spi.go +++ b/rfm69spi.go @@ -107,7 +107,7 @@ func NewSPIDevice() (*SPIDevice, error) { func (d *SPIDevice) Xfer(tx []byte) ([]byte, error) { length := len(tx) rx := make([]byte, length) - ret := C.spi_xfer(d.fd, unsafe.Pointer(&tx[0]), unsafe.Pointer(&rx[0]), C.int(length)) + ret := C.spi_xfer(d.fd, (*C.char)(unsafe.Pointer(&tx[0])), (*C.char)(unsafe.Pointer(&rx[0])), C.int(length)) if ret < 0 { return nil, errors.New("could not xfer") }