Silence support and beginnings of proper buffer management.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 3 Oct 2009 00:06:17 +0000 (00:06 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 3 Oct 2009 00:06:17 +0000 (00:06 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@163 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/monitor/monitor.c
firmware/include/command.h
firmware/include/monitor.h
firmware/lib/command.c
firmware/lib/msp430x1612.c
firmware/lib/msp430x2274.c
firmware/lib/msp430x2618.c

index 8828491..a678bbc 100644 (file)
@@ -22,6 +22,11 @@ void monitorhandle(unsigned char app,
     cmddata[0]=memorybyte[cmddataword[0]];
     txdata(app,verb,1);
     break;
+  case MONITOR_SIZEBUF:
+    //TODO make the data length target-specific, varying by ram.
+    cmddataword[0]=0x100;
+    txdata(app,verb,2);
+    break;
   case MONITOR_CHANGE_BAUD:
     //This command, and ONLY this command, does not reply.
     setbaud(cmddata[0]);
@@ -46,6 +51,10 @@ void monitorhandle(unsigned char app,
     P5OUT=cmddata[0];
     txdata(app,verb,1);
     break;
+  case MONITOR_SILENT:
+    silent=cmddata[0];
+    txdata(app,verb,1);
+    break;
   }
 }
 
index ad0ad15..e99a396 100644 (file)
@@ -4,7 +4,8 @@
 */
 
 //! Global data buffer.
-extern unsigned char cmddata[256];
+extern unsigned char cmddata[0x100];
+extern unsigned char silent;
 
 #define cmddataword ((unsigned int*) cmddata)
 #define cmddatalong ((unsigned long*) cmddata)
@@ -33,6 +34,13 @@ extern unsigned char cmddata[256];
 #define MONITOR_OUT 0xA1
 #define MONITOR_IN  0xA2
 
+#define MONITOR_SILENT 0xB0
+
+#define MONITOR_READBUF 0xC0
+#define MONITOR_WRITEBUF 0xC1
+#define MONITOR_SIZEBUF 0xC2
+
+
 //CHIPCON commands
 #define CC_CHIP_ERASE 0x80
 #define CC_WR_CONFIG 0x81
index 8c48600..ecae3fd 100644 (file)
@@ -7,7 +7,6 @@
 #include <io.h>
 #include <iomacros.h>
 
-
 // Generic Commands
 
 //! Overwrite all of RAM with 0xBEEF, then reboot.
index 35afbfb..dadffbd 100644 (file)
@@ -8,6 +8,7 @@
 #include <string.h>
 
 unsigned char cmddata[256];
+unsigned char silent=0;
 
 //! Transmit a string.
 void txstring(unsigned char app,
@@ -37,6 +38,8 @@ void txdata(unsigned char app,
            unsigned char verb,
            unsigned char len){
   unsigned int i=0;
+  if(silent)
+    return;
   serial_tx(app);
   serial_tx(verb);
   serial_tx(len);
index e69d209..ab8c76e 100644 (file)
@@ -6,7 +6,6 @@
 #include <io.h>
 #include <iomacros.h>
 
-
 //! Receive a byte.
 unsigned char serial_rx(){
   char c;
@@ -31,7 +30,6 @@ unsigned char serial1_rx(){
   return c;
 }
 
-
 //! Transmit a byte.
 void serial_tx(unsigned char x){
   while ((IFG1 & UTXIFG0) == 0); //loop until buffer is free
index 823cf02..566174c 100644 (file)
@@ -1,4 +1,5 @@
 
 //platform.h will handle patching Port 5 to be Port 3.
 
+
 #include "msp430x2618.c"
index b25225d..6238fe2 100644 (file)
@@ -1,7 +1,6 @@
 //! MSP430F2618 clock and I/O definitions
 
-// Ought to be portable to other 2xx chips.
-// 2274 looks particularly appealing.
+// Included by other 2xx ports, such as the 2274.
 
 #include "platform.h"