From ac4f16f97333600d417015da9c48889fd86966a1 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Fri, 19 Nov 2021 10:14:41 +0300 Subject: [PATCH] selfcheck.py: fix and simplify firmware version parsing, remove Clover firmware warning --- clover/src/selfcheck.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/clover/src/selfcheck.py b/clover/src/selfcheck.py index 971f253e..d98990e2 100755 --- a/clover/src/selfcheck.py +++ b/clover/src/selfcheck.py @@ -201,18 +201,13 @@ def check_fcu(): if version_str == '': info('no version data available from SITL') - r = re.compile(r'^FW (git tag|version): (v?\d\.\d\.\d.*)$') - is_clover_firmware = False - for ver_line in version_str.split('\n'): - match = r.search(ver_line) - if match is not None: - field, version = match.groups() - info('firmware %s: %s' % (field, version)) - if 'clover' in version or 'clever' in version: - is_clover_firmware = True - - if not is_clover_firmware: - failure('not running Clover PX4 firmware, https://clover.coex.tech/firmware') + for line in version_str.split('\n'): + if line.startswith('FW version: '): + info(line[len('FW version: '):]) + elif line.startswith('FW git tag: '): + info(line[len('FW git tag: '):]) + elif line.startswith('HW arch: '): + info(line[len('HW arch: '):]) est = get_param('SYS_MC_EST_GROUP') if est == 1: