diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/platforms/STM32F3xx/adc_lld.c | 5 | ||||
-rw-r--r-- | os/hal/platforms/STM32F3xx/adc_lld.h | 14 |
2 files changed, 9 insertions, 10 deletions
diff --git a/os/hal/platforms/STM32F3xx/adc_lld.c b/os/hal/platforms/STM32F3xx/adc_lld.c index 22b5bfcad..0d5bed09d 100644 --- a/os/hal/platforms/STM32F3xx/adc_lld.c +++ b/os/hal/platforms/STM32F3xx/adc_lld.c @@ -474,14 +474,13 @@ void adc_lld_start_conversion(ADCDriver *adcp) { dmamode = adcp->dmamode;
ccr = grpp->ccr | (adcp->adcc->CCR & (ADC_CCR_CKMODE_MASK |
ADC_CCR_MDMA_MASK));
- cfgr = grpp->cfgr;
+ cfgr = grpp->cfgr | ADC_CFGR_CONT | ADC_CFGR_DMAEN;
if (grpp->circular) {
dmamode |= STM32_DMA_CR_CIRC;
#if STM32_ADC_DUAL_MODE
ccr |= ADC_CCR_DMACFG_CIRCULAR;
- cfgr |= ADC_CFGR_CONT;
#else
- cfgr |= ADC_CFGR_CONT | ADC_CFGR_DMACFG_CIRCULAR | ADC_CFGR_DMAEN;
+ cfgr |= ADC_CFGR_DMACFG_CIRCULAR;
#endif
}
diff --git a/os/hal/platforms/STM32F3xx/adc_lld.h b/os/hal/platforms/STM32F3xx/adc_lld.h index 140033a77..127678595 100644 --- a/os/hal/platforms/STM32F3xx/adc_lld.h +++ b/os/hal/platforms/STM32F3xx/adc_lld.h @@ -84,13 +84,6 @@ /** @} */
/**
- * @name Threashold register initializer
- * @{
- */
-#define ADC_TR(low, high) (((uint32_t)(high) << 16) | (uint32_t)(low))
-/** @} */
-
-/**
* @name CFGR register configuration helpers
* @{
*/
@@ -531,6 +524,13 @@ struct ADCDriver { /*===========================================================================*/
/**
+ * @name Threashold register initializer
+ * @{
+ */
+#define ADC_TR(low, high) (((uint32_t)(high) << 16) | (uint32_t)(low))
+/** @} */
+
+/**
* @name Sequences building helper macros
* @{
*/
|