Better transmit function for CCSPI.
[goodfet] / firmware / apps / radios / ccspi.c
index 8a8d7e8..a578c92 100644 (file)
@@ -357,6 +357,12 @@ void ccspi_handle_fn( uint8_t const app,
 
     //Wait for last packet to TX.
     //while(ccspi_status()&BIT3);
+    
+    //Flush TX buffer.
+    CLRSS;
+    ccspitrans8(0x09); //SFLUSHTX
+    SETSS;
+    
 
     //Load the packet.
     CLRSS;
@@ -373,12 +379,7 @@ void ccspi_handle_fn( uint8_t const app,
     //Wait for the pulse on SFD, after which the packet has been sent.
     while(!SFD);
     while(SFD);
-
-    //Flush TX buffer.
-    CLRSS;
-    ccspitrans8(0x09); //SFLUSHTX
-    SETSS;
-
+    
     txdata(app,verb,0);
 #else
     debugstr("Can't TX a packet with SFD and FIFOP definitions.");