Doxygen stuff.
[goodfet] / firmware / apps / spi / spi.c
index 21bf66a..94fbf0e 100644 (file)
@@ -1,5 +1,7 @@
-//GoodFET SPI Application
-//Handles basic I/O
+/*! \file spi.c
+  \author Travis Goodspeed
+  \brief SPI Master
+*/
 
 //Higher level left to client application.
 
@@ -15,7 +17,8 @@
 //This could be more accurate.
 //Does it ever need to be?
 #define SPISPEED 0
-#define SPIDELAY(x) delay(x)
+#define SPIDELAY(x)
+//delay(x)
 
 
 //! Set up the pins for SPI mode.
@@ -139,8 +142,7 @@ void spiflash_pokeblock(unsigned long adr,
     spitrans8(buf[i]);
   SETSS;  //Raise !SS to end transaction.
   
-  while(spiflash_status()&0x01)
-    ;
+  //while(spiflash_status()&0x01);
   
   return;
 }
@@ -151,7 +153,7 @@ void spiflash_peek(unsigned char app,
                   unsigned char verb,
                   unsigned char len){
   register char blocks=(len>3?cmddata[3]:1);
-  unsigned char i,j;
+  unsigned char i;
   
   P5OUT&=~SS; //Drop !SS to begin transaction.
   spitrans8(0x03);//Flash Read Command
@@ -184,9 +186,9 @@ void spihandle(unsigned char app,
               unsigned char len){
   unsigned char i;
   
-  
   //Raise !SS to end transaction, just in case we forgot.
-  P5OUT|=SS;  
+  P5OUT|=SS;
+  spisetup();
   
   switch(verb){
     //PEEK and POKE might come later.