1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-16 11:21:18 +03:00

[sam] Fixed initialization of ADC timings (improves analogRead speed by a factor x10)

Discussion:
http://www.djerickson.com/arduino/
http://forum.arduino.cc/index.php?topic=156849
http://forum.arduino.cc/index.php?topic=187693

Fixes #1418
This commit is contained in:
Cristian Maglie
2013-09-26 01:16:27 +02:00
parent e745ed988f
commit f03093332b
2 changed files with 5 additions and 1 deletions

View File

@ -433,7 +433,7 @@ void init( void )
// Initialize Analog Controller
pmc_enable_periph_clk(ID_ADC);
adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX, ADC_STARTUP_FAST);
adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX, /*ADC_STARTUP_FAST*/ 3);
adc_configure_timing(ADC, 0, ADC_SETTLING_TIME_3, 1);
adc_configure_trigger(ADC, ADC_TRIG_SW, 0); // Disable hardware trigger.
adc_disable_interrupt(ADC, 0xFFFFFFFF); // Disable all ADC interrupts.