X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fgoodfet.c;h=97b40c23f1ed8465610cd47554ea068d4ae985c8;hp=4d791f8b3885b5c1c134f865c4c38d95b5f4149f;hb=a3dbd267c9f9a20853ccbf64011ce3e185182106;hpb=602c5212c0b08f5056f639749e0246b4855a4921 diff --git a/firmware/goodfet.c b/firmware/goodfet.c index 4d791f8..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; @@ -119,7 +124,7 @@ int main(void) void (*reboot_function)(void) = (void *) 0xFFFE; init(); - + txstring(MONITOR,OK,"http://goodfet.sf.net/"); @@ -127,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();