changes to a bug on the spit method
[goodfet] / client / goodfet.monitor
index fb92528..b530a4b 100755 (executable)
@@ -18,11 +18,14 @@ if(len(sys.argv)==1):
     print "%s info" % sys.argv[0];
     print "%s call 0x$start" % sys.argv[0];
     print "%s exec '0x35 0x00 0x..'" % sys.argv[0];
+    print "%s listapps [full]" % sys.argv[0]
+    print "%s testleds" % sys.argv[0]
     sys.exit();
 
-#Initailize FET and set baud rate
+#Initialize FET and set baud rate
 client=GoodFET();
 client.serInit()
+#client.verbose=1;
 
 if(sys.argv[1]=="on"):
     client.dir(0xFF);
@@ -45,7 +48,25 @@ if(sys.argv[1]=="exec"):
     client.execute(code);
     
 if(sys.argv[1]=="info"):
+    client.monitor_info()
+if(sys.argv[1]=="infotest"):
+    for foo in range(0,100):
+        client.monitor_info()
+
+if(sys.argv[1]=="clocktest"):
     print "GoodFET with %s MCU" % client.infostring();
+    clocking=client.monitorgetclock();
+    print "Clocked at 0x%04x" % clocking;
+    for foo in range(1,50):
+        client.monitorsetclock(clocking+foo);
+        print "+0x%04x: %s" % (foo,client.infostring());
+        client.monitorsetclock(clocking-foo);
+        print "-0x%04x: %s" % (foo,client.infostring());
+        
+if(sys.argv[1]=="listapps" or sys.argv[1]=="apps"):
+    full = (len(sys.argv) > 2) and (sys.argv[2]=="full")
+    client.monitor_list_apps(full);
+    
 if(sys.argv[1]=="ramfill"):
     client.monitor_ram_pattern();
 if(sys.argv[1]=="ramdepth"):
@@ -67,7 +88,7 @@ if(sys.argv[1]=="dump"):
     h = IntelHex16bit(None);
     i=start;
     while i<stop:
-        h[i>>1]=client.peekword(i);
+        h[i>>1]=client.peek16(i);
         if(i%0x100==0):
             print "Dumped %04x."%i;
         i+=2;
@@ -105,7 +126,5 @@ if(sys.argv[1]=="verify"):
             if(i%0x100==0):
                 print "%04x" % i;
 
-if(sys.argv[1]=="whatever"):
-    for i in [0x24FF, 0x2500, 0x2502, 0x2504]:
-        print "%04x" % client.peekword(i);
-
+if(sys.argv[1]=="testleds"):
+    client.testleds();