     if (packetSize == 0)
         return;
 
+#ifdef DEVICE_MODE_TX
+    readPacket = true;
+#endif
+
+#ifdef DEVICE_MODE_RX
     while (LoRa.available())
     {
         qspDecodeIncomingFrame(&qsp, LoRa.read(), ppm, &rxDeviceState);

}
#endif

void loop(void)
{
#ifdef DEVICE_MODE_TX
    if (LoRa.available()) {
        qspDecodeIncomingFrame(&qsp, LoRa.read(), ppm, &rxDeviceState);
    }
#endif


     * Use interrupt driven approach only on RX side
     * TX interrupts breaks PPM readout
     */ 
// #ifdef DEVICE_MODE_RX
    LoRa.onReceive(onReceive);
// #endif
    LoRa.receive();
#endif

