From 876ec5e62c719f04855f74ecca6bc134728b4d9a Mon Sep 17 00:00:00 2001 From: Friedl Ulrich Date: Tue, 3 Feb 2015 15:58:41 +0100 Subject: [PATCH] Fix for test --- rfm69_test.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/rfm69_test.go b/rfm69_test.go index 3d7a7b6..8f03091 100644 --- a/rfm69_test.go +++ b/rfm69_test.go @@ -14,10 +14,26 @@ func TestRfm69(t *testing.T) { } defer embd.CloseSPI() + if err := embd.InitGPIO(); err != nil { + panic(err) + } + defer embd.CloseGPIO() + + gpio, err := embd.NewDigitalPin(10) + if err != nil { + panic(err) + } + defer gpio.Close() + + if err := gpio.SetDirection(embd.In); err != nil { + panic(err) + } + gpio.ActiveLow(false) + spiBus := embd.NewSPIBus(embd.SPIMode0, 0, 4000000, 8, 0) defer spiBus.Close() - rfm, err := NewDevice(spiBus, 1, 10, true) + rfm, err := NewDevice(spiBus, gpio, 1, 10, true) if err != nil { t.Error(err) }