SmartRF7 is now located on Win32 at its default location.
[goodfet] / client / GoodFETCC.py
index 04826f4..622dae0 100644 (file)
@@ -11,17 +11,28 @@ import binascii;
 from GoodFET import GoodFET;
 from intelhex import IntelHex;
 
-import xml.dom.minidom, time;
+import xml.dom.minidom, time, os;
 
 class GoodFETCC(GoodFET):
     """A GoodFET variant for use with Chipcon 8051 Zigbee SoC."""
     APP=0x30;
     
-    smartrfpath="/opt/smartrf7";
+    smartrfpath=None;
+    def __init__(self,filename=None):
+        """GoodFETCC constructor.
+        Mostly concerned with finding SmartRF7."""
+        if self.smartrfpath==None:
+            self.smartrfpath=os.environ.get("SMARTRF");
+        if self.smartrfpath==None and os.name=='nt':
+            self.smartrfpath="c:/Program Files/Texas Instruments/SmartRF Tools/SmartRF Studio 7";
+        if self.smartrfpath==None:
+            self.smartrfpath="/opt/smartrf7";
+        
+        
     def loadsymbols(self):
         try: self.SRF_loadsymbols();
         except:
-            if self.verbose>0: print "SmartRF not found at %s." % self.smartrfpath;
+            print "SmartRF not found at %s." % self.smartrfpath;
     def SRF_chipdom(self,chip="cc1110", doc="register_definition.xml"):
         """Loads the chip XML definitions from SmartRF7."""
         fn="%s/config/xml/%s/%s" % (self.smartrfpath,chip,doc);
@@ -939,7 +950,9 @@ class GoodFETCC(GoodFET):
         secret=self.CCpeekcodebyte(0);
         #print "Got secret %02x" % secret;
         return secret;
-
+    
+    #FIXME: This is CC1110-specific and duplicates functionality of 
+    #       SmartRF7 integration.
     CCspecfuncregs={
         'P0':0x80,
         'SP':0x81,