Skip to content

Commit 6ae5928

Browse files
committed
[sam] Fixed regression in analogRead() (fails to read multiple channels) (Mark Tillotson)
See arduino#1740 arduino#1634 http://forum.arduino.cc/index.php?topic=203322.msg1509907#msg1509907
1 parent a38e764 commit 6ae5928

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/wiring_analog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ uint32_t analogRead(uint32_t ulPin)
149149

150150
// Enable the corresponding channel
151151
if (ulChannel != latestSelectedChannel) {
152+
adc_enable_channel( ADC, ulChannel );
152153
if ( latestSelectedChannel != -1 )
153154
adc_disable_channel( ADC, latestSelectedChannel );
154-
adc_enable_channel( ADC, ulChannel );
155155
latestSelectedChannel = ulChannel;
156156
}
157157

0 commit comments

Comments
 (0)