File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
cores/arduino/ard_sup/analog Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -161,16 +161,24 @@ uint16_t analogRead(uint8_t pinNumber)
161161 {
162162 if (padNumber == AP3_ADC_DIFF0_PAD)
163163 {
164- Serial.println (" Config diff 0" );
165- retval = ap3_set_pin_to_analog (12 );
166- retval = ap3_set_pin_to_analog (13 );
164+ ap3_err_t retval = AP3_ERR;
165+ retval = ap3_set_pin_to_analog (ap3_gpio_pad2pin (12 ));
166+ retval = ap3_set_pin_to_analog (ap3_gpio_pad2pin (13 ));
167+ if (retval != AP3_OK)
168+ {
169+ return 0 ; // Error
170+ }
171+ }
172+ else if (padNumber == AP3_ADC_DIFF1_PAD)
173+ {
174+ ap3_err_t retval = AP3_ERR;
175+ retval = ap3_set_pin_to_analog (ap3_gpio_pad2pin (14 ));
176+ retval = ap3_set_pin_to_analog (ap3_gpio_pad2pin (15 ));
167177 if (retval != AP3_OK)
168178 {
169- // Serial.println("Error - set pin to analog");
170179 return 0 ; // Error
171180 }
172181 }
173-
174182 else if (ap3_set_pin_to_analog (pinNumber) != AP3_OK)
175183 {
176184 // Serial.println("Error - set pin to analog");
You can’t perform that action at this time.
0 commit comments