From 0d6f0d8ae390c2ae59cf92d6f37f363aa2e68c80 Mon Sep 17 00:00:00 2001 From: travisutk Date: Fri, 28 Sep 2012 10:52:33 +0000 Subject: [PATCH] CCSPI bug fixes. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1282 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- firmware/apps/radios/ccspi.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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