Fixed bug #520.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7106 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
ff9bc27d92
commit
a91b8d62dd
|
@ -159,6 +159,8 @@ void adc_lld_start(ADCDriver *adcp) {
|
||||||
}
|
}
|
||||||
#endif /* STM32_ADC_USE_ADC1 */
|
#endif /* STM32_ADC_USE_ADC1 */
|
||||||
|
|
||||||
|
ADC->CCR = (ADC->CCR & ADC_CCR_TSVREFE) | (STM32_ADC_ADCPRE << 16);
|
||||||
|
|
||||||
/* ADC initial setup, starting the analog part here in order to reduce
|
/* ADC initial setup, starting the analog part here in order to reduce
|
||||||
the latency when starting a conversion.*/
|
the latency when starting a conversion.*/
|
||||||
adcp->adc->CR1 = 0;
|
adcp->adc->CR1 = 0;
|
||||||
|
|
|
@ -175,6 +175,20 @@
|
||||||
#define STM32_DMA_REQUIRED
|
#define STM32_DMA_REQUIRED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * @brief ADC frequency.
|
||||||
|
* */
|
||||||
|
/* ADC clock related settings and checks.*/
|
||||||
|
#if STM32_ADC_ADCPRE == ADC_CCR_ADCPRE_DIV1
|
||||||
|
#define STM32_ADCCLK STM32_HSICLK
|
||||||
|
#elif STM32_ADC_ADCPRE == ADC_CCR_ADCPRE_DIV2
|
||||||
|
#define STM32_ADCCLK (STM32_HSICLK / 2)
|
||||||
|
#elif STM32_ADC_ADCPRE == ADC_CCR_ADCPRE_DIV4
|
||||||
|
#define STM32_ADCCLK (STM32_HSICLK / 4)
|
||||||
|
#else
|
||||||
|
#error "invalid STM32_ADC_ADCPRE value specified"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver data structures and types. */
|
/* Driver data structures and types. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
|
@ -770,11 +770,6 @@
|
||||||
#error "invalid STM32_RTCSEL value specified"
|
#error "invalid STM32_RTCSEL value specified"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief ADC frequency.
|
|
||||||
*/
|
|
||||||
#define STM32_ADCCLK STM32_HSICLK
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief USB frequency.
|
* @brief USB frequency.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue