X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=firmware%2Fapps%2Favr%2Favr.c;h=953156347217821a47119797905589d0becb302e;hb=704a3e5036b88ba2fc03606d24b0e474b22338e8;hp=1cb67e98ef61703b18edd158caddc08f69f8a596;hpb=b197a5b786af9a49508435b9da27459b8f85ba18;p=goodfet diff --git a/firmware/apps/avr/avr.c b/firmware/apps/avr/avr.c index 1cb67e9..9531563 100644 --- a/firmware/apps/avr/avr.c +++ b/firmware/apps/avr/avr.c @@ -11,7 +11,7 @@ #include #include "avr.h" -#include "glitch.h" +//#include "glitch.h" //! Setup the AVR pins. void avrsetup(){ @@ -21,11 +21,15 @@ void avrsetup(){ //! Initialized an attached AVR. void avrconnect(){ //set I/O pins - avrsetup(); + avrsetup(); //Cut this? + + SETSS; + //delay(50); //Pulse !RST (SS) at least twice while CLK is low. CLRCLK; CLRSS; + //delay(5); SETSS; CLRCLK; @@ -133,7 +137,6 @@ void avrhandle(unsigned char app, unsigned long len){ unsigned long i; unsigned int at; - static u8 connected=0; /* if(!avr_isready() && connected) @@ -151,9 +154,10 @@ void avrhandle(unsigned char app, avrsetup(); txdata(app,verb,0); break; - case START://returns device code + case START: avrconnect(); - //no break here + txdata(app,verb,0); + break;//Used to fall through here. case AVR_PEEKSIG: for(i=0;i<4;i++) cmddata[i]=avr_sig(i);