From 2951cb7e1b9527723b0c891bf015d9cefaa45fff Mon Sep 17 00:00:00 2001 From: Friedl Ulrich Date: Sat, 7 Feb 2015 20:53:12 +0100 Subject: [PATCH] More log --- rfm69handler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rfm69handler.go b/rfm69handler.go index 43e6c42..37648e5 100644 --- a/rfm69handler.go +++ b/rfm69handler.go @@ -14,6 +14,7 @@ func (r *Device) Loop() chan int { irq := make(chan int) r.gpio.BeginWatch(gpio.EdgeRising, func() { + log.Print("irq") irq <- 1 }) @@ -29,10 +30,13 @@ func (r *Device) Loop() chan int { case dataToTransmit := <-c: // can send? r.SetMode(RF_OPMODE_STANDBY) + r.waitForMode() r.writeFifo(&dataToTransmit) - r.writeReg(REG_DIOMAPPING1, RF_DIOMAPPING1_DIO0_00) + log.Print("transmit") r.SetMode(RF_OPMODE_TRANSMITTER) + r.writeReg(REG_DIOMAPPING1, RF_DIOMAPPING1_DIO0_00) <-irq + log.Print("transmit done") r.SetMode(RF_OPMODE_RECEIVER) r.writeReg(REG_DIOMAPPING1, RF_DIOMAPPING1_DIO0_01) case <-irq: