aboutsummaryrefslogtreecommitdiffstats
path: root/wirish
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-02-17 23:47:31 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2011-02-17 23:47:31 -0500
commit3f76591b3616c07c5a02624aff8649d5fa7e9f4b (patch)
treea14f67949ece269e8868efef9bd662cdccef9132 /wirish
parentf0127b4fa04694e5e123aa3173ffc5a957827682 (diff)
downloadlibrambutan-3f76591b3616c07c5a02624aff8649d5fa7e9f4b.tar.gz
librambutan-3f76591b3616c07c5a02624aff8649d5fa7e9f4b.zip
Generalizing adc_init() to allow user to select sample time
Diffstat (limited to 'wirish')
-rw-r--r--wirish/wirish.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/wirish/wirish.c b/wirish/wirish.c
index 5935f95..aaae9d4 100644
--- a/wirish/wirish.c
+++ b/wirish/wirish.c
@@ -54,7 +54,7 @@ void init(void) {
#if NR_DAC_PINS > 0
dac_init();
#endif
-
+
/* initialize clocks */
rcc_clk_init(RCC_CLKSRC_PLL, RCC_PLLSRC_HSE, RCC_PLLMUL_9);
rcc_set_prescaler(RCC_PRESCALER_AHB, RCC_AHB_SYSCLK_DIV_1);
@@ -64,7 +64,9 @@ void init(void) {
nvic_init();
systick_init(SYSTICK_RELOAD_VAL);
gpio_init();
- adc_init();
+ /* Initialize the ADC for slow conversions, to allow for high
+ impedance inputs. */
+ adc_init(ADC_SMPR_55_5);
timer_init(TIMER1, 1);
timer_init(TIMER2, 1);
timer_init(TIMER3, 1);