From 575a415719d875f88460ec1461408597744f7053 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 10 Jun 2024 09:31:30 -0300 Subject: [PATCH] fix (adc): fixes limit test (#9807) 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 89ddd726159..6788f2eb123 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; }