Better Transmit

master
Friedl Ulrich 10 years ago
parent 05637feaf5
commit b3a45db48a

@ -30,7 +30,9 @@ func (r *Device) Loop() (chan Data, chan Data, chan int) {
for { for {
select { select {
case dataToTransmit := <-txChan: case dataToTransmit := <-txChan:
// can send? // TODO: can send?
r.readWriteReg(REG_PACKETCONFIG2, 0xFB, RF_PACKET2_RXRESTART) // avoid RX deadlocks
err = r.SetMode(RF_OPMODE_STANDBY) err = r.SetMode(RF_OPMODE_STANDBY)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
@ -41,19 +43,19 @@ func (r *Device) Loop() (chan Data, chan Data, chan int) {
log.Fatal(err) log.Fatal(err)
} }
err = r.writeFifo(&dataToTransmit) err = r.writeReg(REG_DIOMAPPING1, RF_DIOMAPPING1_DIO0_00)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
log.Print("transmit") err = r.writeFifo(&dataToTransmit)
log.Print(dataToTransmit)
err = r.writeReg(REG_DIOMAPPING1, RF_DIOMAPPING1_DIO0_00)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
log.Print("transmit")
log.Print(dataToTransmit)
err = r.SetMode(RF_OPMODE_TRANSMITTER) err = r.SetMode(RF_OPMODE_TRANSMITTER)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)

Loading…
Cancel
Save