projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Erase waits for competion to return.
[goodfet]
/
firmware
/
apps
/
spi
/
spi.c
diff --git
a/firmware/apps/spi/spi.c
b/firmware/apps/spi/spi.c
index
f4c6560
..
594e04f
100644
(file)
--- a/
firmware/apps/spi/spi.c
+++ b/
firmware/apps/spi/spi.c
@@
-43,7
+43,7
@@
void spisetup(){
}
}
-//! Read and write an SPI b
it
.
+//! Read and write an SPI b
yte
.
unsigned char spitrans8(unsigned char byte){
unsigned int bit;
//This function came from the SPI Wikipedia article.
unsigned char spitrans8(unsigned char byte){
unsigned int bit;
//This function came from the SPI Wikipedia article.
@@
-187,6
+187,7
@@
void spihandle(unsigned char app,
spitrans8(cmddata[i]);
P5OUT|=SS; //Raise !SS to end transaction.
spitrans8(cmddata[i]);
P5OUT|=SS; //Raise !SS to end transaction.
+
while(spiflash_status()&0x01)//while busy
P1OUT^=1;
P1OUT&=~1;
while(spiflash_status()&0x01)//while busy
P1OUT^=1;
P1OUT&=~1;
@@
-200,10
+201,15
@@
void spihandle(unsigned char app,
P5OUT&=~SS; //Drop !SS to begin transaction.
spitrans8(0xC7);//Chip Erase
P5OUT|=SS; //Raise !SS to end transaction.
P5OUT&=~SS; //Drop !SS to begin transaction.
spitrans8(0xC7);//Chip Erase
P5OUT|=SS; //Raise !SS to end transaction.
+
+
+ while(spiflash_status()&0x01)//while busy
+ P1OUT^=1;
+ P1OUT&=~1;
+
txdata(app,verb,0);
break;
txdata(app,verb,0);
break;
-
case SETUP:
spisetup();
txdata(app,verb,0);
case SETUP:
spisetup();
txdata(app,verb,0);