soc/tools/litex_term: remove character function
This commit is contained in:
parent
5b8566d20f
commit
4bdefbdfba
|
@ -31,10 +31,6 @@ else:
|
||||||
return c
|
return c
|
||||||
|
|
||||||
|
|
||||||
def character(b):
|
|
||||||
return b.decode('latin1')
|
|
||||||
|
|
||||||
|
|
||||||
sfl_magic_len = 14
|
sfl_magic_len = 14
|
||||||
sfl_magic_req = "sL5DdSMmkekro\n"
|
sfl_magic_req = "sL5DdSMmkekro\n"
|
||||||
sfl_magic_ack = "z6IHG7cYDID6o\n"
|
sfl_magic_ack = "z6IHG7cYDID6o\n"
|
||||||
|
@ -161,7 +157,7 @@ class LiteXTerm:
|
||||||
while retry:
|
while retry:
|
||||||
self.write_exact(frame.raw)
|
self.write_exact(frame.raw)
|
||||||
# Get the reply from the device
|
# Get the reply from the device
|
||||||
reply = character(self.serial.read())
|
reply = self.serial.read().decode()
|
||||||
if reply == sfl_ack_success:
|
if reply == sfl_ack_success:
|
||||||
retry = 0
|
retry = 0
|
||||||
elif reply == sfl_ack_crcerror:
|
elif reply == sfl_ack_crcerror:
|
||||||
|
@ -229,7 +225,7 @@ class LiteXTerm:
|
||||||
def reader(self):
|
def reader(self):
|
||||||
try:
|
try:
|
||||||
while self.reader_alive:
|
while self.reader_alive:
|
||||||
c = character(self.serial.read())
|
c = self.serial.read().decode()
|
||||||
if c == '\r':
|
if c == '\r':
|
||||||
sys.stdout.write('\n')
|
sys.stdout.write('\n')
|
||||||
else:
|
else:
|
||||||
|
@ -261,7 +257,7 @@ class LiteXTerm:
|
||||||
b = getkey()
|
b = getkey()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
b = serial.to_bytes([3])
|
b = serial.to_bytes([3])
|
||||||
c = character(b)
|
c = b.decode()
|
||||||
if c == chr(0x03):
|
if c == chr(0x03):
|
||||||
self.stop()
|
self.stop()
|
||||||
elif c == '\n':
|
elif c == '\n':
|
||||||
|
|
Loading…
Reference in New Issue