X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fgoodfet.c;h=f12e278b0179049ce14f2babe83e0924c3b93a4b;hp=11afcdda17bc5717e0a88e0ef2ab52528f7ac55f;hb=7d033e4958693f8a618679d49eeae0ed735f996b;hpb=31f45062572380f91438aa566fe6b83ca66c4951 diff --git a/firmware/goodfet.c b/firmware/goodfet.c index 11afcdd..f12e278 100644 --- a/firmware/goodfet.c +++ b/firmware/goodfet.c @@ -15,7 +15,10 @@ //! Initialize registers and all that jazz. void init(){ + #ifdef DAC12IR int i; + #endif + WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer //LED out and on. @@ -72,9 +75,16 @@ void handle(unsigned char app, case SPI: spihandle(app,verb,len); break; + case NRF: + nrfhandle(app,verb,len); + break; case AVR: avrhandle(app,verb,len); break; + case PIC: + pichandle(app,verb,len); + break; + case I2CAPP: i2chandle(app,verb,len); break; @@ -88,11 +98,16 @@ void handle(unsigned char app, ejtaghandle(app,verb,len); break; case JTAG430: //Also JTAG430X, JTAG430X2 + //Revert this when X2 support returns. jtag430x2handle(app,verb,len); + //jtag430handle(app,verb,len); break; case SMARTCARD: smartcardhandle(app,verb,len); break; + case JTAGARM7TDMI: + jtagarm7tdmihandle(app,verb,len); + break; default: if(pluginhandle){ pluginhandle(app,verb,len); @@ -116,7 +131,7 @@ int main(void) void (*reboot_function)(void) = (void *) 0xFFFE; init(); - + txstring(MONITOR,OK,"http://goodfet.sf.net/"); @@ -124,25 +139,25 @@ int main(void) while(1){ //Magic 3 app=serial_rx(); + + // If the app is the reset byte (0x80) increment and loop + if (app == RESET) { + reset_count++; - // If the app is the reset byte (0x80) increment and loop - if (app == 0x80) { - reset_count++; - - if (reset_count > 4) { - // We could trigger the WDT with either: - // WDTCTL = 0; - // or - // WDTCTL = WDTPW + WDTCNTCL + WDTSSEL + 0x00; - // but instead we'll jump to our reboot function pointer - (*reboot_function)(); - } - - continue; - } else { - reset_count = 0; - } - + if (reset_count > 4) { + // We could trigger the WDT with either: + // WDTCTL = 0; + // or + // WDTCTL = WDTPW + WDTCNTCL + WDTSSEL + 0x00; + // but instead we'll jump to our reboot function pointer + (*reboot_function)(); + } + + continue; + } else { + reset_count = 0; + } + verb=serial_rx(); //len=serial_rx(); len=rxword(); @@ -155,7 +170,7 @@ int main(void) handle(app,verb,len); }else{ //Listen to the blaberring. - for(i-0;i