Flushing on DEBUG messages.
[goodfet] / client / GoodFET.py
index 654995b..27ea0e5 100755 (executable)
@@ -109,6 +109,7 @@ class GoodFET:
             #Debugging string; print, but wait.
             if self.app==0xFF and self.verb==0xFF:
                 print "# DEBUG %s" % self.serialport.read(self.count);
+                sys.stdout.flush();
             else:
                 self.data=self.serialport.read(self.count);
                 return self.data;
@@ -124,6 +125,12 @@ class GoodFET:
         self.data=[app&0xff, verb&0xFF]+data;
         self.writecmd(self.GLITCHAPP,0x81,len(self.data),self.data);
         #return ord(self.data[0]);
+    def glitchstart(self):
+        """Glitch into the AVR application."""
+        self.glitchVerb(self.APP,0x20,None);
+    def glitchstarttime(self):
+        """Measure the timer of the START verb."""
+        return self.glitchTime(self.APP,0x20,None);
     def glitchTime(self,app,verb,data):
         """Time the execution of a verb."""
         if data==None: data=[];