From 1f65fe3df3f2f08cc79b218a8848d9b2ecfeec81 Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Thu, 13 Jun 2024 12:28:52 +1000 Subject: [PATCH] Firmware: keep looking for a board if the provided apj board_id is not a match --- Utilities/Firmware.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Utilities/Firmware.cs b/Utilities/Firmware.cs index 2155be7e67..78edde6b2c 100644 --- a/Utilities/Firmware.cs +++ b/Utilities/Firmware.cs @@ -657,6 +657,14 @@ public bool UploadPX4(string filename, BoardDetect.boards board) up.board_type, up.board_rev, up.bl_rev, up.fw_maxsize, port, up.chip, up.chip_desc, up.extf_maxsize); + // if the apj is not for the detected board type - keep looking + if (up.board_type != fw.board_id) + { + log.InfoFormat("Board type mismatch - keep looking, detected {0}, fw file {1}", up.board_type, fw.board_id); + up.close(); + return; + } + up.ProgressEvent += new Uploader.ProgressEventHandler(up_ProgressEvent); up.LogEvent += new Uploader.LogEventHandler(up_LogEvent); up.identify();