Fix pin adc unit check

IDF5 made 0 valid. Use the NO_ADC macro instead
This commit is contained in:
Scott Shawcroft 2023-10-06 15:55:43 -07:00
parent c9d7195505
commit 15c5e8c806
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
1 changed files with 1 additions and 1 deletions

View File

@ -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);