arm: add host uart driver tests
All host tests currently pass Some async refactors may not work well on device, will try later
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import serial
|
||||
import struct
|
||||
import sys
|
||||
import time
|
||||
|
||||
offset = 0x800
|
||||
tty = 'tty'
|
||||
@@ -41,11 +42,16 @@ def main():
|
||||
s = serial.Serial(tty, baud, timeout=1)
|
||||
write(s, offset, dat)
|
||||
jump(s, offset)
|
||||
last_dat = time.time()
|
||||
|
||||
while True:
|
||||
dat = s.read()
|
||||
if not dat:
|
||||
break
|
||||
if time.time() - last_dat > 1.0:
|
||||
print('Data timeout')
|
||||
break
|
||||
continue
|
||||
last_dat = time.time()
|
||||
sys.stdout.buffer.write(dat)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user