mirror of https://github.com/noisymime/Arduino.git
[sam] Fixed regression in analogRead() (fails to read multiple channels)
Fixes #1740
This commit is contained in:
parent
2e7b645571
commit
a1c4809105
|
@ -10,6 +10,7 @@ ARDUINO 1.5.6 BETA
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
* sam: Fixed wrap-around bug in delay() (Mark Tillotson)
|
* sam: Fixed wrap-around bug in delay() (Mark Tillotson)
|
||||||
|
* sam: Fixed regression in analogRead() (fails to read multiple channels)
|
||||||
|
|
||||||
ARDUINO 1.5.5 BETA 2013.11.28
|
ARDUINO 1.5.5 BETA 2013.11.28
|
||||||
|
|
||||||
|
|
|
@ -149,8 +149,10 @@ uint32_t analogRead(uint32_t ulPin)
|
||||||
|
|
||||||
// Enable the corresponding channel
|
// Enable the corresponding channel
|
||||||
if (ulChannel != latestSelectedChannel) {
|
if (ulChannel != latestSelectedChannel) {
|
||||||
adc_enable_channel( ADC, ulChannel );
|
if ( latestSelectedChannel != -1 )
|
||||||
latestSelectedChannel = ulChannel;
|
adc_disable_channel( ADC, latestSelectedChannel );
|
||||||
|
adc_enable_channel( ADC, ulChannel );
|
||||||
|
latestSelectedChannel = ulChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the ADC
|
// Start the ADC
|
||||||
|
@ -164,9 +166,6 @@ uint32_t analogRead(uint32_t ulPin)
|
||||||
ulValue = adc_get_latest_value(ADC);
|
ulValue = adc_get_latest_value(ADC);
|
||||||
ulValue = mapResolution(ulValue, ADC_RESOLUTION, _readResolution);
|
ulValue = mapResolution(ulValue, ADC_RESOLUTION, _readResolution);
|
||||||
|
|
||||||
// Disable the corresponding channel
|
|
||||||
//adc_disable_channel(ADC, ulChannel);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Compiler could yell because we don't handle DAC pins
|
// Compiler could yell because we don't handle DAC pins
|
||||||
|
|
Loading…
Reference in New Issue