From cf64da21fbea6bc5e641829eef6efdfd9d13b556 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 1 May 2022 14:21:30 -0500 Subject: [PATCH] Move adc multiplier code into battery pin region to surpress warning --- src/Power.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index 6c5301f1..e6fb9422 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -100,12 +100,11 @@ class AnalogBatteryLevel : public HasBatteryLevel #ifndef ADC_MULTIPLIER #define ADC_MULTIPLIER 2.0 #endif - // Override variant or default ADC_MULTIPLIER if we have the override pref - float operativeAdcMultiplier = radioConfig.preferences.adc_multiplier_override > 0 ? - radioConfig.preferences.adc_multiplier_override : - ADC_MULTIPLIER; #ifdef BATTERY_PIN + // Override variant or default ADC_MULTIPLIER if we have the override pref + float operativeAdcMultiplier = radioConfig.preferences.adc_multiplier_override > 0 ? + radioConfig.preferences.adc_multiplier_override : ADC_MULTIPLIER; // Do not call analogRead() often. const uint32_t min_read_interval = 5000; if (millis() - last_read_time_ms > min_read_interval) {