Moved TXFLUSH strobe from Python to C in CC2420 driver.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Tue, 22 Feb 2011 23:28:47 +0000 (23:28 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Tue, 22 Feb 2011 23:28:47 +0000 (23:28 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@938 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETCCSPI.py
client/goodfet.ccspi
firmware/apps/radios/ccspi.c

index 81e5434..36c8bd7 100644 (file)
@@ -168,8 +168,8 @@ class GoodFETCCSPI(GoodFET):
     def RF_txpacket(self,packet):
         """Send a packet through the radio."""
         self.writecmd(self.CCSPIAPP,0x81,len(packet),packet);
     def RF_txpacket(self,packet):
         """Send a packet through the radio."""
         self.writecmd(self.CCSPIAPP,0x81,len(packet),packet);
-        time.sleep(1);
-        self.strobe(0x09);
+        #time.sleep(1);
+        #self.strobe(0x09);
         return;
     
     def RF_carrier(self):
         return;
     
     def RF_carrier(self):
index 63fc5e0..b9d269d 100755 (executable)
@@ -106,13 +106,12 @@ if(sys.argv[1]=="txtest"):
         client.RF_getsmac(),
         client.RF_getfreq()/10**6);
     
         client.RF_getsmac(),
         client.RF_getfreq()/10**6);
     
+    
     while 1:
         client.RF_txpacket([0x0f, 0x01, 0x08, 0x82,
                             0xff, 0xff, 0xff, 0xff,
     while 1:
         client.RF_txpacket([0x0f, 0x01, 0x08, 0x82,
                             0xff, 0xff, 0xff, 0xff,
-                            0x4d, 0x7d, 0x09, 0x00,
-                            0x1f, 0x00, 0xc0]);
-        print client.status();
-        print;
+                            0xde, 0xad, 0xbe, 0xef,
+                            0xba, 0xbe, 0xc0]);
 
 if(sys.argv[1]=="peek"):
     start=0x0000;
 
 if(sys.argv[1]=="peek"):
     start=0x0000;
index f47e54c..377a5f0 100644 (file)
@@ -199,16 +199,6 @@ void ccspi_handle_fn( uint8_t const app,
   case CCSPI_TX:
 #ifdef FIFOP
     
   case CCSPI_TX:
 #ifdef FIFOP
     
-    /* //Has there been an overflow?
-    if(ccspi_status()&BIT5){
-      debugstr("Clearing underflow");
-      CLRSS;
-      ccspitrans8(0x09); //SFLUSHTX
-      SETSS;
-    } 
-    */
-    
-        
     //Wait for last packet to TX.
     //while(ccspi_status()&BIT3);
     
     //Wait for last packet to TX.
     //while(ccspi_status()&BIT3);
     
@@ -224,6 +214,14 @@ void ccspi_handle_fn( uint8_t const app,
     ccspitrans8(0x04); //STXON
     SETSS;
     
     ccspitrans8(0x04); //STXON
     SETSS;
     
+    //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
     
     txdata(app,verb,0);
 #else