From 70d98336bc28a9b2b396c8d06e41d93f6d5a04a0 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 23 Nov 2021 16:15:39 +1100 Subject: [PATCH] AP_BattMonitor: make logging dependent on HAL_LOGGING_ENABLED not HAL_BUILD_AP_PERIPH We have logging on some periphs now --- libraries/AP_BattMonitor/AP_BattMonitor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_BattMonitor/AP_BattMonitor.cpp b/libraries/AP_BattMonitor/AP_BattMonitor.cpp index 52b3d63800..b180c9b0ef 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor.cpp +++ b/libraries/AP_BattMonitor/AP_BattMonitor.cpp @@ -373,7 +373,7 @@ void AP_BattMonitor::convert_dynamic_param_groups(uint8_t instance) // read - For all active instances read voltage & current; log BAT, BCL, POWR void AP_BattMonitor::read() { -#ifndef HAL_BUILD_AP_PERIPH +#if HAL_LOGGING_ENABLED AP_Logger *logger = AP_Logger::get_singleton(); if (logger != nullptr && logger->should_log(_log_battery_bit)) { logger->Write_Power(); @@ -384,8 +384,8 @@ void AP_BattMonitor::read() if (drivers[i] != nullptr && get_type(i) != Type::NONE) { drivers[i]->read(); drivers[i]->update_resistance_estimate(); - -#ifndef HAL_BUILD_AP_PERIPH + +#if HAL_LOGGING_ENABLED if (logger != nullptr && logger->should_log(_log_battery_bit)) { const uint64_t time_us = AP_HAL::micros64(); drivers[i]->Log_Write_BAT(i, time_us);