mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-11 16:00:57 +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):
|
while io.poll([io.TOUCH], r, 10000):
|
||||||
pass
|
pass
|
||||||
# wait for event
|
# wait for event
|
||||||
|
touch = False
|
||||||
while True:
|
while True:
|
||||||
if io.poll([io.TOUCH], r, 10000) and r[0] == io.TOUCH and r[1][0] == io.TOUCH_END:
|
if not touch:
|
||||||
print('OK %d %d' % (r[1][1], r[1][2]))
|
if io.poll([io.TOUCH], r, 10000) and r[0] == io.TOUCH and r[1][0] == io.TOUCH_START:
|
||||||
break
|
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:
|
if utime.ticks_us() > deadline:
|
||||||
print('ERROR TIMEOUT')
|
print('ERROR TIMEOUT')
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user