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
35 //! Handle a command.
\r
36 void handle(unsigned char app,
\r
39 //debugstr("GoodFET");
\r
42 monitorhandle(app,verb,len);
\r
45 spihandle(app,verb,len);
\r
48 i2chandle(app,verb,len);
\r
51 cchandle(app,verb,len);
\r
54 jtaghandle(app,verb,len);
\r
56 case JTAG430: //Also JTAG430X, JTAG430X2
\r
57 jtag430x2handle(app,verb,len);
\r
61 pluginhandle(app,verb,len);
\r
63 debugstr("Plugin missing.");
\r
74 volatile unsigned int i;
\r
75 unsigned char app, verb;
\r
80 txstring(MONITOR,OK,"http://goodfet.sf.net/");
\r
82 //Command loop. There's no end!
\r
90 //Read data, looking for buffer overflow.y
\r
91 if(len<=CMDDATALEN){
\r
93 cmddata[i]=serial_rx();
\r
95 handle(app,verb,len);
\r
97 //Listen to the blaberring.
\r
100 //Reply with an error.
\r
101 debugstr("Buffer length exceeded.");
\r
102 txdata(MONITOR,NOK,0);
\r