CVS: jtag/msp430 MSP430mspgcc.c,1.15,1.16

Chris Liechti <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/jtag/msp430
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27063/jtag/msp430

Modified Files:
	MSP430mspgcc.c 
Log Message:
revert to old reliable memory read

Index: MSP430mspgcc.c
===================================================================
RCS file: /cvsroot/mspgcc/jtag/msp430/MSP430mspgcc.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -d -r1.15 -r1.16
--- MSP430mspgcc.c	10 Mar 2006 03:42:13 -0000	1.15
+++ MSP430mspgcc.c	4 Apr 2006 21:52:43 -0000	1.16
@@ -16,7 +16,7 @@
 
 // #defines. ------------------------------------------------------------------
 
-#define DLL_VERSION             4      // DLL version.
+#define DLL_VERSION             5      // DLL version.
 
 // (File) Global variables. ---------------------------------------------------
 static BOOL jtagReleased = FALSE;
@@ -463,8 +463,10 @@
     WORD memValue;
     BOOL adjustLast = FALSE;
     WORD i;
+    if (count <= 0) RET_ERR(PARAMETER_ERR); // negative sizes are not allowed
+        
     if (rw) {   //read
-        MSP430_Log(1, "MSP430mspgcc: MSP430_MemoryRead...\n");
+        MSP430_Log(1, "MSP430mspgcc: MSP430_MemoryRead(0x&04x, %d)...\n", address, count);
         if (address < WORD_REG_START_ADDR) {    // Process all byte addresses first.
             doneCount = WORD_REG_START_ADDR - (WORD) address;
             if (count < doneCount) {
@@ -484,22 +486,22 @@
                 adjustLast = TRUE;
                 count--;
             }
-            ReadMemQuick((WORD) (address + doneCount),
-                         (WORD) ((count - doneCount) / 2),
-                         (WORD*) (buffer + doneCount)
-            );
-            //~ //slow but reliable upload, instead of ReadMemQuick
-            //~ //but this is 3 times or so slower....
-            //~ for (i=0; i<(count - doneCount)/2; i++) {
-                //~ ((WORD*)(&buffer[doneCount]))[i] = ReadMem(F_WORD, (WORD)(address + doneCount + i*2));
-            //~ }
+            //~ ReadMemQuick((WORD) (address + doneCount),
+                         //~ (WORD) ((count - doneCount) / 2),
+                         //~ (WORD*) (buffer + doneCount)
+            //~ );
+            //slow but reliable upload, instead of ReadMemQuick
+            //but this is 3 times or so slower....
+            for (i=0; i<(count - doneCount)/2; i++) {
+                ((WORD*)(&buffer[doneCount]))[i] = ReadMem(F_WORD, (WORD)(address + doneCount + i*2));
+            }
             if (adjustLast) {
                 memValue = ReadMem(F_WORD, (WORD)(address + count));
                 *(buffer + count) = memValue & 0xFF;
             }
         }
     } else {    //write
-        MSP430_Log(1, "MSP430mspgcc: MSP430_MemoryWrite...\n");
+        MSP430_Log(1, "MSP430mspgcc: MSP430_MemoryWrite(0x&04x, %d)...\n", address, count);
         if (address < WORD_REG_START_ADDR) {    // Process all byte addresses first.
             doneCount = WORD_REG_START_ADDR - (WORD) address;
             if (count < doneCount)



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.