 // If DEBUG reporting is turned on, we report every "ReportVoltageDelay" measurements.
 //----------------------------------------
 
-int batt_report_count = 0;
-  
+#if (DEBUG & DEBUG_BATT)
+  int batt_report_count = 0;
+#endif
+
 void measure_battery(void)
 {
   // get the time since the last measurement

const int MaxOffsetDigits = 5;

// battery voltage limits
const float MaxVoltage = 8.0;   // battery voltage for "100% full"
const float MinVoltage = 6.4;   // battery voltage for "0% full"

// macro to get number of elements in an array
#define ALEN(a)    (sizeof(a)/sizeof((a)[0]))


void display_battery(void)
{
#if SHOW_VOLTAGE
  // display measured voltage
  sprintf(FreqBuffer, "%.2fv", MeasuredVoltage);
  lcd.setCursor(9, 1);
  lcd.print(FreqBuffer);
#endif

  // create special battery character
  lcd.createChar(BatteryChar, BatterySymbol);

