CVS: python msp430-downloader.py,1.3,1.4 msp430-ram-usage.py,1.1,1.2

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

Modified Files:
	msp430-downloader.py msp430-ram-usage.py 
Log Message:
easier to get executable on *nix systems

Index: msp430-downloader.py
===================================================================
RCS file: /cvsroot/mspgcc/python/msp430-downloader.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- msp430-downloader.py	24 Oct 2004 01:54:54 -0000	1.3
+++ msp430-downloader.py	20 Nov 2004 04:35:02 -0000	1.4
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 """
 Simple tool to download stuff to a MSP430.
 

Index: msp430-ram-usage.py
===================================================================
RCS file: /cvsroot/mspgcc/python/msp430-ram-usage.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- msp430-ram-usage.py	13 Nov 2004 01:47:39 -0000	1.1
+++ msp430-ram-usage.py	20 Nov 2004 04:35:02 -0000	1.2
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 """
 This is a little tool to parse msp430-readelf's output and format it nicely.
 It can be usefule to get an overview of the RAM usage and free stack memory.
@@ -80,7 +81,11 @@
 
 if options.compact:
     for address in range(objs['__data_start'][0], objs['__stack'][0], 16):
-        print '0x%04x: %s' % (address, ''.join([mmap.has_key(a) and '*' or '.' for a in range(address,address+16)]))
+        print '0x%04x: %s' % (
+            address,
+            ''.join([mmap.has_key(a) and '*' or '.' 
+                     for a in range(address,address+16)])
+        )
 
 #scan backwards for continous memory, starting from the stack init
 stackmem = 0
@@ -92,4 +97,6 @@
 size = objs['__stack'][0] - objs['__data_start'][0]
 print 'RAM usage summary:'
 print '%d of %d bytes used (%d free)' % (size-free, size, free)
-print 'the stack can grow up to %d bytes (continous memory at end of RAM)' % (stackmem&0xfffe)
+print 'the stack can grow up to %d bytes (continous memory at end of RAM)' % (
+    stackmem & 0xfffe   #round size, even number
+)



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
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.