diff options
| author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-05-18 20:23:56 -0400 |
|---|---|---|
| committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-05-19 18:45:45 -0400 |
| commit | cd723c2f0eb258a748021be58a82d4f73469b469 (patch) | |
| tree | 88488660c64a720d7d63070db7fdce573b1bafc8 | |
| parent | 7444fc5a7a1cfa18b2d3cfd7c5774db6cdf5e555 (diff) | |
adc.c: adc_init() doesn't set the RCC's ADC prescaler.
You have to call rcc_set_prescaler() yourself now. adc_init() never
should have been doing that anyway.
| -rw-r--r-- | libmaple/adc.c | 5 | ||||
| -rw-r--r-- | wirish/boards.cpp | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libmaple/adc.c b/libmaple/adc.c index 73dce0a..16ca8bc 100644 --- a/libmaple/adc.c +++ b/libmaple/adc.c @@ -62,13 +62,12 @@ const adc_dev *ADC3 = &adc3; /** * @brief Initialize an ADC peripheral. * - * Initializes the RCC clock line for the given peripheral, using ADC - * prescaler RCC_ADCPRE_PCLK_DIV_6. Resets ADC device registers. + * Initializes the RCC clock line for the given peripheral. Resets + * ADC device registers. * * @param dev ADC peripheral to initialize */ void adc_init(const adc_dev *dev) { - rcc_set_prescaler(RCC_PRESCALER_ADC, RCC_ADCPRE_PCLK_DIV_6); rcc_clk_enable(dev->clk_id); rcc_reset_dev(dev->clk_id); } diff --git a/wirish/boards.cpp b/wirish/boards.cpp index 9e25eeb..3dc48cb 100644 --- a/wirish/boards.cpp +++ b/wirish/boards.cpp @@ -106,6 +106,7 @@ static void setupNVIC() { static void adcDefaultConfig(const adc_dev* dev); static void setupADC() { + rcc_set_prescaler(RCC_PRESCALER_ADC, RCC_ADCPRE_PCLK_DIV_6); adc_foreach(adcDefaultConfig); } |
