From: travisutk Date: Fri, 28 Sep 2012 10:52:33 +0000 (+0000) Subject: CCSPI bug fixes. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=0d6f0d8ae390c2ae59cf92d6f37f363aa2e68c80;hp=42fb9b3f29135873b470a44686d5eafe863392f4 CCSPI bug fixes. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1282 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/firmware/apps/radios/ccspi.c b/firmware/apps/radios/ccspi.c index a124b53..9a9c13d 100644 --- a/firmware/apps/radios/ccspi.c +++ b/firmware/apps/radios/ccspi.c @@ -265,13 +265,20 @@ void ccspi_handle_fn( uint8_t const app, debugstr("Clearing overflow"); CLRSS; ccspitrans8(0x08); //SFLUSHRX + ccspitrans8(0x08); //SFLUSHRX SETSS; txdata(app,verb,0); //no packet return; } - + + /* Uncomment this to wait around a bit for the packet. + Might reduce dropped packet count. + i=1000; //Number of tries. + while(!(FIFOP&&FIFO) && i--); + */ + //Is there a packet? - if(FIFOP&&FIFO){ + if (FIFOP && FIFO){ //Wait for completion. while(SFD); @@ -289,8 +296,8 @@ void ccspi_handle_fn( uint8_t const app, A software fix is to reset the CC2420 between packets. This works, but a better solution is desired. */ - for(i=0;i