From 15d3ec31137b47d2968694fc54903f467c1fb006 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 30 Dec 2023 08:33:06 +1100 Subject: [PATCH] AP_ESC_Telem: allow IOMCU to work in example fw example firmwares don't instantate AP_ESC_Telem --- libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp index 0048571452..46f5aa6145 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp @@ -20,14 +20,19 @@ #if HAL_WITH_ESC_TELEM #include +#include extern const AP_HAL::HAL& hal; AP_ESC_Telem_Backend::AP_ESC_Telem_Backend() { _frontend = AP_ESC_Telem::_singleton; +#if !APM_BUILD_TYPE(APM_BUILD_UNKNOWN) + // we allow for no frontend in example fw and tools to make it + // possible to run them on hardware with IOMCU if (_frontend == nullptr) { AP_HAL::panic("No ESC frontend"); } +#endif } // callback to update the rpm in the frontend, should be called by the driver when new data is available