Better transmit function for CCSPI.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 25 Dec 2011 23:29:21 +0000 (23:29 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 25 Dec 2011 23:29:21 +0000 (23:29 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1075 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

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);
 
     //Wait for last packet to TX.
     //while(ccspi_status()&BIT3);
+    
+    //Flush TX buffer.
+    CLRSS;
+    ccspitrans8(0x09); //SFLUSHTX
+    SETSS;
+    
 
     //Load the packet.
     CLRSS;
 
     //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);
     //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.");
     txdata(app,verb,0);
 #else
     debugstr("Can't TX a packet with SFD and FIFOP definitions.");