try to do proper resetting
This commit is contained in:
parent
1974e6d5c4
commit
b0bfb1b8f7
1 changed files with 11 additions and 10 deletions
|
@ -36,15 +36,12 @@ class SerialHandler(asyncio.Protocol):
|
|||
# clear any incoming data
|
||||
transport.serial.flushInput()
|
||||
|
||||
#transport.serial.write(b'1')
|
||||
#time.sleep(.1)
|
||||
#transport.serial.write(b'5')
|
||||
#time.sleep(.1)
|
||||
#transport.serial.write(b'6')
|
||||
#time.sleep(.1)
|
||||
|
||||
if args.start:
|
||||
transport.serial.write(b'04')
|
||||
transport.serial.write(b'1')
|
||||
time.sleep(.1)
|
||||
transport.serial.write(b'5')
|
||||
time.sleep(.1)
|
||||
transport.serial.write(b'6')
|
||||
time.sleep(.1)
|
||||
|
||||
content = in_file.read()
|
||||
length = len(content)
|
||||
|
@ -58,7 +55,11 @@ class SerialHandler(asyncio.Protocol):
|
|||
written += transport.serial.write(content[length - (length - written):])
|
||||
|
||||
print("wrote {} bytes of rom".format(written))
|
||||
#transport.serial.write(b'4')
|
||||
|
||||
if args.start:
|
||||
transport.serial.write(b'4')
|
||||
time.sleep(.1)
|
||||
transport.serial.write(b'0')
|
||||
|
||||
def connection_lost(self, exc):
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue