Skip to content

Commit 575a415

Browse files
authored
fix (adc): fixes limit test (espressif#9807)
Fixes analogContinuousSetWidth() border test.
1 parent 034d568 commit 575a415

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cores/esp32/esp32-hal-adc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ void analogContinuousSetAtten(adc_attenuation_t attenuation) {
682682
}
683683

684684
void analogContinuousSetWidth(uint8_t bits) {
685-
if ((bits < SOC_ADC_DIGI_MIN_BITWIDTH) && (bits > SOC_ADC_DIGI_MAX_BITWIDTH)) {
685+
if ((bits < SOC_ADC_DIGI_MIN_BITWIDTH) || (bits > SOC_ADC_DIGI_MAX_BITWIDTH)) {
686686
log_e("Selected width cannot be set. Range is from %d to %d", SOC_ADC_DIGI_MIN_BITWIDTH, SOC_ADC_DIGI_MAX_BITWIDTH);
687687
return;
688688
}

0 commit comments

Comments
 (0)