try to do proper resetting

This commit is contained in:
Morgan 'ARR\!' Allen 2020-01-18 11:41:02 -08:00
parent 1974e6d5c4
commit b0bfb1b8f7

View file

@ -36,15 +36,12 @@ class SerialHandler(asyncio.Protocol):
# clear any incoming data # clear any incoming data
transport.serial.flushInput() transport.serial.flushInput()
#transport.serial.write(b'1') transport.serial.write(b'1')
#time.sleep(.1) time.sleep(.1)
#transport.serial.write(b'5') transport.serial.write(b'5')
#time.sleep(.1) time.sleep(.1)
#transport.serial.write(b'6') transport.serial.write(b'6')
#time.sleep(.1) time.sleep(.1)
if args.start:
transport.serial.write(b'04')
content = in_file.read() content = in_file.read()
length = len(content) length = len(content)
@ -58,7 +55,11 @@ class SerialHandler(asyncio.Protocol):
written += transport.serial.write(content[length - (length - written):]) written += transport.serial.write(content[length - (length - written):])
print("wrote {} bytes of rom".format(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): def connection_lost(self, exc):
pass pass