2 \author Travis Goodspeed
\r
5 This is the main module of the GoodFET, which calls the initialization
\r
6 routines and delegates commands to the various applications.
\r
10 #include "platform.h"
\r
11 #include "command.h"
\r
19 //! Initialize registers and all that jazz.
\r
21 WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
\r
27 //Setup clocks, unique to each '430.
\r
31 //Enable Interrupts.
\r
38 //! Handle a command.
\r
39 void handle(unsigned char app,
\r
42 //debugstr("GoodFET");
\r
45 monitorhandle(app,verb,len);
\r
48 spihandle(app,verb,len);
\r
51 avrhandle(app,verb,len);
\r
54 i2chandle(app,verb,len);
\r
57 cchandle(app,verb,len);
\r
60 jtaghandle(app,verb,len);
\r
62 case JTAG430: //Also JTAG430X, JTAG430X2
\r
63 jtag430x2handle(app,verb,len);
\r
67 pluginhandle(app,verb,len);
\r
69 debugstr("Plugin missing.");
\r
80 volatile unsigned int i;
\r
81 unsigned char app, verb;
\r
86 txstring(MONITOR,OK,"http://goodfet.sf.net/");
\r
88 //Command loop. There's no end!
\r
96 //Read data, looking for buffer overflow.y
\r
97 if(len<=CMDDATALEN){
\r
99 cmddata[i]=serial_rx();
\r
101 handle(app,verb,len);
\r
103 //Listen to the blaberring.
\r
106 //Reply with an error.
\r
107 debugstr("Buffer length exceeded.");
\r
108 txdata(MONITOR,NOK,0);
\r