diff --git a/tests/production_tests/main.py b/tests/production_tests/main.py index 34d86c3d10..24c13d5d3d 100644 --- a/tests/production_tests/main.py +++ b/tests/production_tests/main.py @@ -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