X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fgoodfet.c;h=97b40c23f1ed8465610cd47554ea068d4ae985c8;hp=11afcdda17bc5717e0a88e0ef2ab52528f7ac55f;hb=950a6f9bb0c1a9778f4a8de71557a23e8ac7e9ef;hpb=31f45062572380f91438aa566fe6b83ca66c4951 diff --git a/firmware/goodfet.c b/firmware/goodfet.c index 11afcdd..97b40c2 100644 --- a/firmware/goodfet.c +++ b/firmware/goodfet.c @@ -75,6 +75,11 @@ void handle(unsigned char app, case AVR: avrhandle(app,verb,len); break; +#ifdef INSTALL_PIC_APP + case PIC: + pichandle(app,verb,len); + break; +#endif case I2CAPP: i2chandle(app,verb,len); break; @@ -93,6 +98,9 @@ void handle(unsigned char app, case SMARTCARD: smartcardhandle(app,verb,len); break; + case JTAGARM7TDMI: + jtagarm7tdmihandle(app,verb,len); + break; default: if(pluginhandle){ pluginhandle(app,verb,len); @@ -116,7 +124,7 @@ int main(void) void (*reboot_function)(void) = (void *) 0xFFFE; init(); - + txstring(MONITOR,OK,"http://goodfet.sf.net/"); @@ -124,25 +132,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 +163,7 @@ int main(void) handle(app,verb,len); }else{ //Listen to the blaberring. - for(i-0;i