From 712dfe4a55b1261618fa9b7eea709d7dcf61edda Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Fri, 7 Jun 2024 20:10:19 -0300 Subject: [PATCH] fix (adc): fixes limit test Fixes analogContinuousSetWidth() border test. --- cores/esp32/esp32-hal-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-adc.c b/cores/esp32/esp32-hal-adc.c index ed9108b6a7f..384e175d282 100644 --- a/cores/esp32/esp32-hal-adc.c +++ b/cores/esp32/esp32-hal-adc.c @@ -682,7 +682,7 @@ void analogContinuousSetAtten(adc_attenuation_t attenuation) { } void analogContinuousSetWidth(uint8_t bits) { - if ((bits < SOC_ADC_DIGI_MIN_BITWIDTH) && (bits > SOC_ADC_DIGI_MAX_BITWIDTH)) { + if ((bits < SOC_ADC_DIGI_MIN_BITWIDTH) || (bits > SOC_ADC_DIGI_MAX_BITWIDTH)) { log_e("Selected width cannot be set. Range is from %d to %d", SOC_ADC_DIGI_MIN_BITWIDTH, SOC_ADC_DIGI_MAX_BITWIDTH); return; }