From ec68e1e83a60ad197078d4fde1d42a55004270e5 Mon Sep 17 00:00:00 2001 From: theStack Date: Tue, 15 Dec 2009 02:59:35 +0100 Subject: [PATCH] sendByte()-sleep is only needed in bootloader-mode --- frprog.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frprog.py b/frprog.py index 6c39418..4959ea2 100755 --- a/frprog.py +++ b/frprog.py @@ -13,9 +13,12 @@ KERNEL_BAUDRATE=115200 # contains the last received checksum from a READ, WRITE or CHECKSUM command last_checksum = 0 +# is set to True if we are already communicating with the pkernel +pkernelmode = False def sendByte(byte): - time.sleep(0.001) # just to get sure, wait 1ms + if pkernelmode == False: + time.sleep(0.001) # just to get sure, wait 1ms tty.write(chr(byte)) def sendWord(word): @@ -234,6 +237,7 @@ print cmdCALL(0x30000) time.sleep(0.5) # just to get sure that the pkernel is really running! del tty +pkernelmode = True tty = SerialPort(DEVICE, None, KERNEL_BAUDRATE) print "Performing ChipErase..." -- 2.25.1