//! Initialize registers and all that jazz.
void init(){
+ #ifdef DAC12IR
int i;
+ #endif
+
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
//LED out and on.
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;
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);
void (*reboot_function)(void) = (void *) 0xFFFE;
init();
-
+
txstring(MONITOR,OK,"http://goodfet.sf.net/");
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();
handle(app,verb,len);
}else{
//Listen to the blaberring.
- for(i-0;i<len;i++)
+ for(i=0;i<len;i++)
serial_rx();
//Reply with an error.
debugstr("Buffer length exceeded.");