mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 23:08:14 +00:00
tests/production_tests: in touch test, wait for TOUCH_START first
This commit is contained in:
parent
49cc4651c2
commit
0aa8cbfe51
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user