From 4f15f54c753ae78ea85e34db688b564c4dfbd09f Mon Sep 17 00:00:00 2001 From: Friedl Ulrich Date: Sun, 8 Feb 2015 21:44:04 +0100 Subject: [PATCH] TX Power --- rfm69d/rfm69d.go | 2 +- rfm69device.go | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/rfm69d/rfm69d.go b/rfm69d/rfm69d.go index c435f5a..06914c9 100644 --- a/rfm69d/rfm69d.go +++ b/rfm69d/rfm69d.go @@ -25,7 +25,7 @@ func main() { } defer spiBus.Close() - rfm, err := rfm69.NewDevice(spiBus, pin, 1, 10, true) + rfm, err := rfm69.NewDevice(spiBus, pin, 1, 10, false) if err != nil { log.Fatal(err) } diff --git a/rfm69device.go b/rfm69device.go index 9d1b7fe..31f3750 100644 --- a/rfm69device.go +++ b/rfm69device.go @@ -117,10 +117,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 } - //digitalWrite(_slaveSelectPin, HIGH) - //pinMode(_slaveSelectPin, OUTPUT) - //SPI.begin() - 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) @@ -160,13 +156,10 @@ func (r *Device) setup() error { if err != nil { return err } - r.waitForMode() - //while((readReg(REG_IRQFLAGS1) & RF_IRQFLAGS1_MODEREADY) == 0x00) // wait for ModeReady - //attachInterrupt(_interruptNum, RFM69::isr0, RISING); - //selfPointer = this - //_address = nodeID - return nil + err = r.waitForMode() + + return err } func (r *Device) waitForMode() error {