File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ bool lookupAdc(uint16_t pin, AdcInfo& info)
2020 for (unsigned adc = 0 ; adc < SOC_ADC_PERIPH_NUM; ++adc) {
2121 for (unsigned ch = 0 ; ch < SOC_ADC_MAX_CHANNEL_NUM; ++ch) {
2222 if (adc_channel_io_map[adc][ch] == pin) {
23- info.adc = adc_unit_t (adc + 1 );
23+ info.adc = adc_unit_t (adc);
2424 info.channel = adc_channel_t (ch);
2525 return true ;
2626 }
Original file line number Diff line number Diff line change 1212
1313#pragma once
1414
15+ #include < soc/adc_channel.h>
16+
1517#define EXTERNAL_NUM_INTERRUPTS 16
1618#define NUM_DIGITAL_PINS 40
1719#define NUM_ANALOG_INPUTS 16
2022#define digitalPinToInterrupt (p ) (((p) < 40 ) ? (p) : -1 )
2123#define digitalPinHasPWM (p ) (p < 34 )
2224
23- constexpr uint8_t A0{ 36 } ;
25+ constexpr uint8_t A0 = ADC1_CHANNEL_0_GPIO_NUM ;
2426
2527#define GPIO_REG_TYPE uint32_t
2628
You can’t perform that action at this time.
0 commit comments