CVS: python/msp430 clock.py,1.2,1.3

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

Modified Files:
	clock.py 
Log Message:
small update to debug outputs

Index: clock.py
===================================================================
RCS file: /cvsroot/mspgcc/python/msp430/clock.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- clock.py	29 Dec 2005 14:01:48 -0000	1.2
+++ clock.py	18 Jan 2006 11:07:24 -0000	1.3
@@ -28,12 +28,13 @@
        return: frequency in Hz"""
     funclet = memory.Memory()
     funclet.loadTIText(cStringIO.StringIO(COUNTER_FUNCLET))
-    #XXX dcor
+    
     funclet[0].data = funclet[0].data[:6] \
                     + chr(dcoctl) + chr(bcsctl1) + chr(bcsctl2) \
                     + funclet[0].data[9:]
     runtime = jtag._parjtag.funclet(funclet[0].data, 100)
     count = jtag._parjtag.regread(14) | (jtag._parjtag.regread(15) << 16)
+    
     return 1000*count*4/runtime
 
 def setDCO(fmin, fmax, maxrsel=7, dcor=False):
@@ -57,7 +58,7 @@
             lower = False
         frequency = getDCOFreq(dco, bcs1, dcor and 1 or 0)
         if frequency > fmax:
-            if debug: sys.stderr.write("%luHz is too high, decreasing (was: BCSCTL1=0x%02x; DCOCTL=0x%02x\n" % (frequency, bcs1, dco))
+            if debug: sys.stderr.write("%luHz is too high, decreasing (was: BCSCTL1=0x%02x; DCOCTL=0x%02x)\n" % (frequency, bcs1, dco))
             upper = True
             dco -= resolution
             if dco <= 0:
@@ -73,7 +74,7 @@
                     else:
                         raise IOError("Couldn't get DCO working with correct frequency. Device is not slower than %dHz." % (frequency,))
         elif frequency < fmin:
-            if debug: sys.stderr.write("%luHz is too low, increasing (was: BCSCTL1=0x%02x; DCOCTL=0x%02x\n" % (frequency, bcs1, dco))
+            if debug: sys.stderr.write("%luHz is too low, increasing (was: BCSCTL1=0x%02x; DCOCTL=0x%02x)\n" % (frequency, bcs1, dco))
             lower = True
             dco += resolution
             if dco > 255:
@@ -89,7 +90,7 @@
                     else:
                         raise IOError("Couldn't get DCO working with correct frequency. Device is not faster than %dHz." % (frequency,))
         else:
-            if debug: sys.stderr.write("%luHz is OK (BCSCTL1=0x%02x; DCOCTL=0x%02x\n" % (frequency, bcs1, dco))
+            if debug: sys.stderr.write("%luHz is OK (BCSCTL1=0x%02x; DCOCTL=0x%02x)\n" % (frequency, bcs1, dco))
             return frequency, dco, bcs1
     raise IOError("Couldn't get DCO working with correct frequency. Tolerance too tight? Last frequency was %dHz" % (frequency,))
 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&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.