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:
2023-06-02 23:33:01 -07:00
parent 1f2f08e525
commit f274749050
14 changed files with 494 additions and 97 deletions

View File

@@ -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)