1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

[sam] fixing analog according to updated pmc api

This commit is contained in:
Thibaut VIARD 2012-04-28 12:11:40 +02:00
parent c0a5eb38e2
commit f09771258e

View File

@ -122,8 +122,8 @@ uint32_t analogRead(uint32_t ulPin)
case ADC8 : case ADC8 :
case ADC9 : case ADC9 :
case ADC10 : case ADC10 :
case ADC11 : case ADC11 :
// Enable the corresponding channel // Enable the corresponding channel
adc_enable_channel( ADC, ulChannel ); adc_enable_channel( ADC, ulChannel );
@ -227,7 +227,7 @@ void analogWrite(uint32_t ulPin, uint32_t ulValue) {
uint32_t chA = channelToAB[channel]; uint32_t chA = channelToAB[channel];
if (!TCChanEnabled[chNo]) { if (!TCChanEnabled[chNo]) {
PMC_EnablePeripheral(TC_INTERFACE_ID + chNo); pmc_enable_periph_clk(TC_INTERFACE_ID + chNo);
TC_Configure(TC_INTERFACE, chNo, TC_Configure(TC_INTERFACE, chNo,
TC_CMR_TCCLKS_TIMER_CLOCK1 | TC_CMR_TCCLKS_TIMER_CLOCK1 |
TC_CMR_WAVE | TC_CMR_WAVE |