Fix pin adc unit check
IDF5 made 0 valid. Use the NO_ADC macro instead
This commit is contained in:
parent
c9d7195505
commit
15c5e8c806
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self,
|
void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self,
|
||||||
const mcu_pin_obj_t *pin) {
|
const mcu_pin_obj_t *pin) {
|
||||||
if (pin->adc_index == 0 || pin->adc_channel == NO_ADC_CHANNEL) {
|
if (pin->adc_index == NO_ADC || pin->adc_channel == NO_ADC_CHANNEL) {
|
||||||
raise_ValueError_invalid_pin();
|
raise_ValueError_invalid_pin();
|
||||||
}
|
}
|
||||||
common_hal_mcu_pin_claim(pin);
|
common_hal_mcu_pin_claim(pin);
|
||||||
|
|
Loading…
Reference in New Issue