File tree 1 file changed +13
-5
lines changed
cores/arduino/ard_sup/analog
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)
161
161
{
162
162
if (padNumber == AP3_ADC_DIFF0_PAD)
163
163
{
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 ));
167
177
if (retval != AP3_OK)
168
178
{
169
- // Serial.println("Error - set pin to analog");
170
179
return 0 ; // Error
171
180
}
172
181
}
173
-
174
182
else if (ap3_set_pin_to_analog (pinNumber) != AP3_OK)
175
183
{
176
184
// Serial.println("Error - set pin to analog");
You can’t perform that action at this time.
0 commit comments