From cf9a3ada2898b63a65e98ff1fbc50da9bdfc00fa Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Thu, 22 Jun 2023 19:07:43 +0100 Subject: [PATCH] GCS_MAVLink: print out IOMCU mcuid on startup --- libraries/GCS_MAVLink/GCS_Common.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 818b37695f..54e9b32221 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -88,6 +88,11 @@ #endif #include +#if HAL_WITH_IO_MCU +#include +extern AP_IOMCU iomcu; +#endif + #include extern const AP_HAL::HAL& hal; @@ -4210,6 +4215,16 @@ void GCS_MAVLINK::send_banner() send_text(MAV_SEVERITY_INFO, "%s", sysid); } + // send MCUID if we can +#if HAL_WITH_IO_MCU +#define REVID_MASK 0xFFFF0000 +#define DEVID_MASK 0xFFF + if (AP_BoardConfig::io_enabled()) { + uint32_t mcuid = iomcu.get_mcu_id(); + send_text(MAV_SEVERITY_INFO, "IOMCU: %x %x", uint16_t(mcuid & DEVID_MASK), uint16_t((mcuid & REVID_MASK) >> 16U)); + } +#endif + // send RC output mode info if available char banner_msg[50]; if (hal.rcout->get_output_mode_banner(banner_msg, sizeof(banner_msg))) {