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;