         msgptr++;
       }
     }
-    if(msgptr > 254) { messagebuff = ""; Serial.print("X!"); } 
+    if(msgptr > 254) { messagebuff = ""; Serial.print("X!"); }
+    
+   if(afsk.decoder.read() || afsk.rxPacketCount()) {
+      Serial.println("got pkt");
+      // A true return means something was put onto the packet FIFO
+      // If we actually have data packets in the buffer, process them all now
+      while(afsk.rxPacketCount()) {
+        AFSK::Packet *packet = afsk.getRXPacket();
+        Serial.print(F("Packet: "));
+        if(packet) {
+          packet->printPacket(&Serial);
+          AFSK::PacketBuffer::freePacket(packet);
+        }
+      }
+    }
 }
     
 

  //PORTD |= _BV(2); // Diagnostic pin (D2)
  dds.clockTick();
  if(++tcnt == 1) {
    if(afsk.encoder.isSending()) {
      afsk.timer();
    }
    tcnt = 0;

  //PORTD &= ~(_BV(2)); // Pin D2 off again
}

