Skip to content

Commit 269f352

Browse files
authored
Merge pull request #8607 from dhalbert/esp32-analogin
Esp32 AnalogIn IO32 fix
2 parents 1151d1b + 80f8979 commit 269f352

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ports/espressif/common-hal/analogio/AnalogIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self,
5656
const mcu_pin_obj_t *pin) {
57-
if (pin->adc_index == 0 || pin->adc_channel == ADC_CHANNEL_MAX) {
57+
if (pin->adc_index == NO_ADC || pin->adc_channel == NO_ADC_CHANNEL) {
5858
raise_ValueError_invalid_pin();
5959
}
6060
common_hal_mcu_pin_claim(pin);

ports/espressif/peripherals/esp32/pins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const mcu_pin_obj_t pin_GPIO27 = PIN(27, ADC_UNIT_2, ADC_CHANNEL_7, TOUCH_PAD_NU
5959
// no GPIO29
6060
// no GPIO30
6161
// no GPIO31
62-
const mcu_pin_obj_t pin_GPIO32 = PIN(32, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH_PAD_NUM9);
62+
const mcu_pin_obj_t pin_GPIO32 = PIN(32, ADC_UNIT_1, ADC_CHANNEL_4, TOUCH_PAD_NUM9);
6363
const mcu_pin_obj_t pin_GPIO33 = PIN(33, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH_PAD_NUM8);
6464
const mcu_pin_obj_t pin_GPIO34 = PIN(34, ADC_UNIT_1, ADC_CHANNEL_6, NO_TOUCH_CHANNEL);
6565
const mcu_pin_obj_t pin_GPIO35 = PIN(35, ADC_UNIT_1, ADC_CHANNEL_7, NO_TOUCH_CHANNEL);

0 commit comments

Comments
 (0)