aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/platforms/STM32F3xx/adc_lld.c5
-rw-r--r--os/hal/platforms/STM32F3xx/adc_lld.h14
-rw-r--r--testhal/STM32F3xx/ADC/main.c4
3 files changed, 11 insertions, 12 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
* @{
*/
diff --git a/testhal/STM32F3xx/ADC/main.c b/testhal/STM32F3xx/ADC/main.c
index 4d4add7d6..4b7bcc7e1 100644
--- a/testhal/STM32F3xx/ADC/main.c
+++ b/testhal/STM32F3xx/ADC/main.c
@@ -21,7 +21,7 @@
#include "ch.h"
#include "hal.h"
-#define ADC_GRP1_NUM_CHANNELS 1
+#define ADC_GRP1_NUM_CHANNELS 2
#define ADC_GRP1_BUF_DEPTH 8
#define ADC_GRP2_NUM_CHANNELS 8
@@ -64,7 +64,7 @@ static const ADCConversionGroup adcgrpcfg1 = {
NULL,
adcerrorcallback,
0, /* CFGR */
- 0, /* TR1 */
+ ADC_TR(0, 4095), /* TR1 */
0, /* CCR */
{ /* SMPR[2] */
0,