only flush once for a sequence, detect 0xffs seqs
[pyfrprog.git] / frprog.py
index b7371c1cfa226c6d2b14877d936a7fa32a3438fe..da4f399dcdbdc179a4d63b50f984e77bd0962768 100755 (executable)
--- a/frprog.py
+++ b/frprog.py
@@ -15,7 +15,6 @@ last_checksum = 0
 def sendByte(byte):
        time.sleep(0.001) # just to get sure, wait 1ms
        tty.write(chr(byte))
-       tty.flush()
 
 def sendWord(word):
        sendByte(word & 0xFF)
@@ -194,6 +193,7 @@ for seq in flashseqs:
                continue
        print "RAMing", len(seq.data), "bytes at address", hex(addr)
        cmdWRITE(addr, len(seq.data), seq.data)
+       tty.flush()
 
 cmdCALL(0x30000);
 sys.exit(0)