From 80a4e9945f900a8d499b14cd4d410ec2ebdc4a0c Mon Sep 17 00:00:00 2001 From: Friedl Ulrich Date: Tue, 24 Feb 2015 21:57:46 +0100 Subject: [PATCH] Cleanup --- device.go | 4 ---- handler.go | 7 ++----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/device.go b/device.go index a6b6609..4ffe65a 100644 --- a/device.go +++ b/device.go @@ -46,9 +46,7 @@ func NewDevice(spi *spidev.SPIDevice, gpio gpio.Pin, nodeID, networkID byte, isR powerLevel: 31, } - log.Println("before setup") err := ret.setup() - log.Println("after setup") return ret, err } @@ -73,7 +71,6 @@ func (r *Device) readReg(addr byte) (byte, error) { if err != nil { log.Println(err) } - //log.Printf("read %x: %x", addr, rx[1]) return rx[1], err } @@ -118,7 +115,6 @@ func (r *Device) setup() error { /* 0x6F */ {REG_TESTDAGC, RF_DAGC_IMPROVED_LOWBETA0}, // run DAGC continuously in RX mode for Fading Margin Improvement, recommended default for AfcLowBetaOn=0 } - log.Println("start setup") for data, err := r.readReg(REG_SYNCVALUE1); err == nil && data != 0xAA; data, err = r.readReg(REG_SYNCVALUE1) { err := r.writeReg(REG_SYNCVALUE1, 0xAA) if err != nil { diff --git a/handler.go b/handler.go index 98cffaa..9f788c0 100644 --- a/handler.go +++ b/handler.go @@ -16,7 +16,6 @@ func (r *Device) Loop() (chan Data, chan Data, chan int) { irq := make(chan int) r.gpio.BeginWatch(gpio.EdgeRising, func() { - log.Print("irq") irq <- 1 }) @@ -53,8 +52,7 @@ func (r *Device) Loop() (chan Data, chan Data, chan int) { log.Fatal(err) } - log.Print("transmit") - log.Print(dataToTransmit) + log.Print("transmit", dataToTransmit) err = r.SetMode(RF_OPMODE_TRANSMITTER) if err != nil { @@ -101,8 +99,7 @@ func (r *Device) Loop() (chan Data, chan Data, chan int) { return } - log.Print("receive") - log.Print(data) + log.Print("receive", data) if data.ToAddress != 255 && data.RequestAck { resp := Data{