Port of lowpowerlab RFM69 Packet radio library for HopeRF RFM69H with hacks from debugging with a FRDM-KL25Z

Dependents:   chuk

Fork of RFM69 by B Rey

Revision:
4:a6b314434ab4
Parent:
3:9d44479041c3
Child:
5:dd8ff3ab5e2a
--- a/RFM69.cpp	Fri Jun 19 13:03:45 2015 +0000
+++ b/RFM69.cpp	Mon Jun 06 13:11:58 2016 +0000
@@ -515,6 +515,7 @@
     if(!(_promiscuousMode || TARGETID==_address || TARGETID==RF69_BROADCAST_ADDR) //match this node's address, or $
       || PAYLOADLEN < 3) { // address situation could receive packets that are malformed and don't fit this libraries extra fields
       PAYLOADLEN = 0;
+      unselect();
     } else {
       DATALEN = PAYLOADLEN - 3;
       SENDERID = _spi.write(0);
@@ -528,9 +529,9 @@
         DATA[i] = _spi.write(0);
       }
       if (DATALEN < RF69_MAX_DATA_LEN) DATA[DATALEN] = 0; // add null at end of string
+      unselect();
+      setMode(RF69_MODE_RX);
     }
-    unselect();
-    //setMode(RF69_MODE_RX);
     RSSI = readRSSI(0);
   }
 }