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
25 PLEDOUT &= ~PLEDPIN;
\r
27 //Setup clocks, unique to each '430.
\r
31 //Enable Interrupts.
\r
36 //! Handle a command.
\r
37 void handle(unsigned char app,
\r
40 //debugstr("GoodFET");
\r
43 monitorhandle(app,verb,len);
\r
46 spihandle(app,verb,len);
\r
49 avrhandle(app,verb,len);
\r
52 i2chandle(app,verb,len);
\r
55 cchandle(app,verb,len);
\r
58 jtaghandle(app,verb,len);
\r
60 case JTAG430: //Also JTAG430X, JTAG430X2
\r
61 jtag430x2handle(app,verb,len);
\r
65 pluginhandle(app,verb,len);
\r
67 debugstr("Plugin missing.");
\r
78 volatile unsigned int i;
\r
79 unsigned char app, verb;
\r
84 txstring(MONITOR,OK,"http://goodfet.sf.net/");
\r
86 //Command loop. There's no end!
\r
94 //Read data, looking for buffer overflow.y
\r
95 if(len<=CMDDATALEN){
\r
97 cmddata[i]=serial_rx();
\r
99 handle(app,verb,len);
\r
101 //Listen to the blaberring.
\r
104 //Reply with an error.
\r
105 debugstr("Buffer length exceeded.");
\r
106 txdata(MONITOR,NOK,0);
\r