From 1f1a84ec643fd495dc9721cf414942b5362eba9b Mon Sep 17 00:00:00 2001 From: orcaman98 <40060523+orcaman98@users.noreply.github.com> Date: Tue, 29 Jan 2019 22:04:04 -0500 Subject: [PATCH] Update to resolve issue #44 To resolve compile error for unused variable. --- EmonLib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EmonLib.cpp b/EmonLib.cpp index eb04dc8..1c036ed 100644 --- a/EmonLib.cpp +++ b/EmonLib.cpp @@ -227,8 +227,7 @@ void EnergyMonitor::serialprint() //and Jérôme who alerted us to http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/ long EnergyMonitor::readVcc() { - long result; - + //not used on emonTx V3 - as Vcc is always 3.3V - eliminates bandgap error and need for calibration http://harizanov.com/2013/09/thoughts-on-avr-adc-accuracy/ #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined (__AVR_ATmega328P__) @@ -247,6 +246,7 @@ long EnergyMonitor::readVcc() { #if defined(__AVR__) + long result; delay(2); // Wait for Vref to settle ADCSRA |= _BV(ADSC); // Convert while (bit_is_set(ADCSRA,ADSC));