Rearranging firmware for use with Doxygen.
[goodfet] / firmware / apps / spi / spi.c
index e91ab61..6fe0151 100644 (file)
@@ -1,5 +1,9 @@
-//GoodFET SPI Application
-//Handles basic I/O
+/*! \file spi.c
+  \author Travis Goodspeed
+  
+  This is an implementation of the SPI protocol
+  for the GoodFET project.
+*/
 
 //Higher level left to client application.
 
@@ -15,7 +19,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 +144,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;
 }
@@ -185,7 +189,8 @@ void spihandle(unsigned char app,
   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.