From f3b93d55fbb4bc5e55025a96878cbaf8758968b4 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Oct 2020 17:03:04 +0800 Subject: [PATCH] oops fix for esp32 --- src/Power.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index 62d07003..7d67c733 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -63,13 +63,11 @@ class AnalogBatteryLevel : public HasBatteryLevel */ virtual float getBattVoltage() { - uint32_t raw = analogRead(BATTERY_PIN); - // Tested ttgo eink nrf52 board and the reported value is perfect // DEBUG_MSG("raw val %u", raw); return #ifdef BATTERY_PIN - 1000.0 * 2.0 * (AREF_VOLTAGE / 1024.0) * raw; + 1000.0 * 2.0 * (AREF_VOLTAGE / 1024.0) * analogRead(BATTERY_PIN); #else NAN; #endif