From a82b7f20c930343332ca85f274c203d7308a75bc Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 25 Nov 2022 09:42:27 +1100 Subject: [PATCH] AP_HAL_ChibiOS: use HAL_LOGGING_ENABLED in place of HAL_BOOTLOADER_BUILD bootloader already disables GCS, so we can rely on HAL_GCS_ENABLED in place of HAL_BOOTLOADER_BUILD --- libraries/AP_HAL_ChibiOS/Util.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/Util.cpp b/libraries/AP_HAL_ChibiOS/Util.cpp index 85308f5345..6488aa2b04 100644 --- a/libraries/AP_HAL_ChibiOS/Util.cpp +++ b/libraries/AP_HAL_ChibiOS/Util.cpp @@ -37,7 +37,8 @@ #include #include #endif -#ifndef HAL_BOOTLOADER_BUILD +#include +#if HAL_LOGGING_ENABLED #include #endif @@ -267,6 +268,7 @@ uint64_t Util::get_hw_rtc() const #if AP_BOOTLOADER_FLASHING_ENABLED #if HAL_GCS_ENABLED +#include #define Debug(fmt, args ...) do { gcs().send_text(MAV_SEVERITY_INFO, fmt, ## args); } while (0) #endif // HAL_GCS_ENABLED @@ -761,7 +763,7 @@ bool Util::get_true_random_vals(uint8_t* data, size_t size, uint32_t timeout_us) */ void Util::log_stack_info(void) { -#if !defined(HAL_BOOTLOADER_BUILD) && HAL_LOGGING_ENABLED +#if HAL_LOGGING_ENABLED static thread_t *last_tp; static uint8_t thread_id; thread_t *tp = last_tp;