Skip to content

Commit b530742

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

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

build/shared/revisions.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARDUINO 1.5.6 BETA
1010

1111
[core]
1212
* sam: Fixed wrap-around bug in delay() (Mark Tillotson)
13-
* sam: Fixed regression in analogRead() (fails to read multiple channels)
13+
* sam: Fixed regression in analogRead() (fails to read multiple channels) (Mark Tillotson)
1414

1515
ARDUINO 1.5.5 BETA 2013.11.28
1616

hardware/arduino/sam/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)