CVS: python/mspgcc bsl.py,1.1,1.2

Chris Liechti <[email protected]> Sun, 23 Apr 2006 14:37:37 -0700
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/python/mspgcc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31912/python/mspgcc

Modified Files:
	bsl.py 
Log Message:
add a more general memory write method

Index: bsl.py
===================================================================
RCS file: /cvsroot/mspgcc/python/mspgcc/bsl.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- bsl.py	11 Apr 2006 18:35:23 -0000	1.1
+++ bsl.py	23 Apr 2006 21:37:35 -0000	1.2
@@ -689,6 +689,23 @@
         sys.stderr.write("\r%d%%" % (100*count/total))
         sys.stderr.flush()
 
+    def programBlock(self, address, data):
+        """Memory write. The block is segmented and downloaded to the target."""
+        currentAddr = address
+        pstart = 0
+        count = 0
+        total_length = len(data)
+        while pstart < total_length:
+            length = self.maxData
+            if pstart + length > total_length:
+                length = total_length - pstart
+            self.programBlk(currentAddr, data[pstart:pstart+length], self.ACTION_PROGRAM | self.ACTION_VERIFY)
+            pstart = pstart + length
+            currentAddr = currentAddr + length
+            #~ self.byteCtr = self.byteCtr + length #total sum
+            #~ count = count + length
+            #~ if self.showprogess:
+                #~ self.progess_update(count, total)
     #segments:
     #list of tuples or lists:
     #segements = [ (addr1, [d0,d1,d2,...]), (addr2, [e0,e1,e2,...])]



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642