1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 15:28:10 +00:00

tests/production_tests: in touch test, wait for TOUCH_START first

This commit is contained in:
Jan Pochyla 2017-09-20 14:05:03 +02:00
parent 49cc4651c2
commit 0aa8cbfe51

View File

@ -63,10 +63,15 @@ def test_touch(v):
while io.poll([io.TOUCH], r, 10000):
pass
# wait for event
touch = False
while True:
if io.poll([io.TOUCH], r, 10000) and r[0] == io.TOUCH and r[1][0] == io.TOUCH_END:
print('OK %d %d' % (r[1][1], r[1][2]))
break
if not touch:
if io.poll([io.TOUCH], r, 10000) and r[0] == io.TOUCH and r[1][0] == io.TOUCH_START:
touch = True
else:
if io.poll([io.TOUCH], r, 10000) and r[0] == io.TOUCH and r[1][0] == io.TOUCH_END:
print('OK %d %d' % (r[1][1], r[1][2]))
break
if utime.ticks_us() > deadline:
print('ERROR TIMEOUT')
break