From: travisutk Date: Tue, 22 Feb 2011 23:28:47 +0000 (+0000) Subject: Moved TXFLUSH strobe from Python to C in CC2420 driver. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=ca4deae50d7d2098d372d903d33879f9f951c75c Moved TXFLUSH strobe from Python to C in CC2420 driver. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@938 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/client/GoodFETCCSPI.py b/client/GoodFETCCSPI.py index 81e5434..36c8bd7 100644 --- a/client/GoodFETCCSPI.py +++ b/client/GoodFETCCSPI.py @@ -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); - time.sleep(1); - self.strobe(0x09); + #time.sleep(1); + #self.strobe(0x09); return; def RF_carrier(self): diff --git a/client/goodfet.ccspi b/client/goodfet.ccspi index 63fc5e0..b9d269d 100755 --- a/client/goodfet.ccspi +++ b/client/goodfet.ccspi @@ -106,13 +106,12 @@ if(sys.argv[1]=="txtest"): client.RF_getsmac(), client.RF_getfreq()/10**6); + 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; diff --git a/firmware/apps/radios/ccspi.c b/firmware/apps/radios/ccspi.c index f47e54c..377a5f0 100644 --- a/firmware/apps/radios/ccspi.c +++ b/firmware/apps/radios/ccspi.c @@ -199,16 +199,6 @@ void ccspi_handle_fn( uint8_t const app, 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); @@ -224,6 +214,14 @@ void ccspi_handle_fn( uint8_t const app, 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