Flushing on DEBUG messages.
[goodfet] / client / goodfet.cc
index 2cd9e5f..6682650 100755 (executable)
@@ -90,6 +90,8 @@ if(sys.argv[1]=="dumpdata"):
     h.write_hex_file(f);
 if(sys.argv[1]=="status"):
     print "Status: %s" %client.CCstatusstr();
+if(sys.argv[1]=="info"):
+    print "%s" % client.CCidentstr();
 if(sys.argv[1]=="erase"):
     print "Status: %s" % client.CCstatusstr();
     client.CCchiperase();
@@ -146,16 +148,16 @@ if(sys.argv[1]=="flash"):
    
      h = IntelHex(f);
      page = 0x0000;
-     pagelen = 2048; #2kB pages in 32-bit words
+     pagelen = client.CCpagesize(); #2048; #2kB pages in 32-bit words
+     
+     print "page=%04x, pagelen=%04x" % (page,pagelen);
+     
      bcount = 0;
      
-     print "Wiping Flash."
-     #Wipe all of flash.
-     #client.CCchiperase();
      #Wipe the RAM buffer for the next flash page.
      client.CCeraseflashbuffer();
      for i in h._buf.keys():
-         while(i>page+pagelen):
+         while(i>=page+pagelen):
              if bcount>0:
                  client.CCflashpage(page);
                  #client.CCeraseflashbuffer();