From 181eff46ac43f47dc2205d91bd1e77ac6f7f8d04 Mon Sep 17 00:00:00 2001 From: Shiv Tyagi Date: Fri, 26 Nov 2021 00:25:38 +0530 Subject: [PATCH] Tools: fix autotest for devo telemetry We should pass(skip) the autotest when devo telemetry is compiled out --- Tools/autotest/common.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 8b1df87585..4784bc4434 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -691,6 +691,8 @@ class DEVO(Telem): self.HEADER = 0xAA self.frame_length = 20 + + # frame is 'None' until we receive a frame with VALID header and checksum self.frame = None self.bad_chars = 0 @@ -11064,14 +11066,19 @@ switch value''' tstart = self.get_sim_time_cached() while True: + self.drain_mav() now = self.get_sim_time_cached() if now - tstart > 10: - raise AutoTestTimeoutException("Failed to get devo data") + if devo.frame is not None: + # we received some frames but could not find correct values + raise AutoTestTimeoutException("Failed to get correct data") + else: + # No frames received. Devo telemetry is compiled out? + break devo.update() frame = devo.frame if frame is None: - self.progress("No data received") continue m = self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True)