X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fapps%2Fspi%2Fspi.c;h=6e503f230f41f9def34edcb494ba3fdecbf67294;hp=94fbf0e4d09fdf97ca46b9fdadd82844c76c7e0e;hb=e3e1bb605963def746b50f62277180e567d3b615;hpb=ae09939eb8c62c83f244527e7916cee5f9145e6c;ds=sidebyside diff --git a/firmware/apps/spi/spi.c b/firmware/apps/spi/spi.c index 94fbf0e..6e503f2 100644 --- a/firmware/apps/spi/spi.c +++ b/firmware/apps/spi/spi.c @@ -66,9 +66,11 @@ unsigned char spitrans8(unsigned char byte){ //! Enable SPI writing void spiflash_wrten(){ SETSS; + /* P5OUT&=~SS; //Drop !SS to begin transaction. spitrans8(0x04);//Write Disable P5OUT|=SS; //Raise !SS to end transaction. + */ P5OUT&=~SS; //Drop !SS to begin transaction. spitrans8(0x06);//Write Enable P5OUT|=SS; //Raise !SS to end transaction. @@ -142,7 +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; } @@ -205,7 +207,7 @@ void spihandle(unsigned char app, case SPI_JEDEC://Grab 3-byte JEDEC ID. P5OUT&=~SS; //Drop !SS to begin transaction. spitrans8(0x9f); - len=3; + len=3; //Length is variable in some chips, 3 minimum. for(i=0;i