autotest: fix race condition in button test

The subsequent test could end up arming the vehicle based on this left-over state.
This commit is contained in:
Peter Barker 2022-06-15 23:25:21 +10:00 committed by Peter Barker
parent 4a015bd479
commit 08ae4f050c
1 changed files with 2 additions and 0 deletions

View File

@ -10445,12 +10445,14 @@ switch value'''
self.progress("Skipping arm/disarm tests for tracker")
return
self.context_push()
self.wait_ready_to_arm()
self.set_parameter("BTN_FUNC%u" % btn, 153) # ARM/DISARM
self.set_parameter("SIM_PIN_MASK", mask)
self.wait_armed()
self.set_parameter("SIM_PIN_MASK", 0)
self.wait_disarmed()
self.context_pop()
if self.is_rover():
self.context_push()