From 08c114fd2224a840cc79c2ed24fc8c8094123384 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 5 Oct 2022 22:27:27 +0200 Subject: [PATCH] Fixed minor typo in ESP32 code which broke everything --- DCCTimerESP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DCCTimerESP.cpp b/DCCTimerESP.cpp index f48d5d5..2b10f18 100644 --- a/DCCTimerESP.cpp +++ b/DCCTimerESP.cpp @@ -152,8 +152,9 @@ void DCCTimer::reset() { } int ADCee::init(uint8_t pin) { pinMode(pin, ANALOG); + adc1_config_width(ADC_WIDTH_BIT_12); adc1_config_channel_atten(pinToADC1Channel(pin),ADC_ATTEN_DB_11); - return local_adc1_get_raw(pinToADC1Channel(pin)); + return adc1_get_raw(pinToADC1Channel(pin)); } /* * Read function ADCee::read(pin) to get value instead of analogRead(pin) @@ -168,7 +169,6 @@ void ADCee::scan() { } void ADCee::begin() { - adc1_config_width(ADC_WIDTH_BIT_12); } #endif //ESP32