From 124be247c7b7d01eec102662ffea09053298ffa9 Mon Sep 17 00:00:00 2001 From: Gabrielerusso Date: Sun, 11 Feb 2024 19:20:20 +0100 Subject: [PATCH] Fixed ESP32 ADC resolution bug introduced by #3184 Fixed ESP32 ADC resolution bug introduced by #3184 as esp32 analog resolution is already set some line of code before to 12 bit default. For our usage wouldn't be faster to use 10 bit? . --- src/Power.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Power.cpp b/src/Power.cpp index 38f8ed771..24f5eee0b 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -390,7 +390,10 @@ bool Power::analogInit() analogReference(AR_INTERNAL); // 3.6V #endif #endif // ARCH_NRF52 + +#ifndef ARCH_ESP32 analogReadResolution(BATTERY_SENSE_RESOLUTION_BITS); +#endif batteryLevel = &analogLevel; return true;