mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
STM32F7: warn if no DMA2 configured when using ADC with DMA. Also correct ADC channel numbers that DMA callback passes to upper half driver.
This commit is contained in:
committed by
Gregory Nutt
parent
de22d24f8e
commit
54eae7dcde
@@ -1014,7 +1014,6 @@ config STM32F7_ADC1
|
|||||||
bool "ADC1"
|
bool "ADC1"
|
||||||
default n
|
default n
|
||||||
select STM32F7_ADC
|
select STM32F7_ADC
|
||||||
select STM32F7_HAVE_ADC1_DMA if STM32F7_DMA1
|
|
||||||
select STM32F7_HAVE_ADC1_DMA if STM32F7_DMA2
|
select STM32F7_HAVE_ADC1_DMA if STM32F7_DMA2
|
||||||
|
|
||||||
config STM32F7_ADC2
|
config STM32F7_ADC2
|
||||||
@@ -1027,8 +1026,7 @@ config STM32F7_ADC3
|
|||||||
bool "ADC3"
|
bool "ADC3"
|
||||||
default n
|
default n
|
||||||
select STM32F7_ADC
|
select STM32F7_ADC
|
||||||
select STM32F7_HAVE_ADC1_DMA if STM32F7_DMA1
|
select STM32F7_HAVE_ADC3_DMA if STM32F7_DMA2
|
||||||
select STM32F7_HAVE_ADC1_DMA if STM32F7_DMA2
|
|
||||||
|
|
||||||
config STM32F7_BKPSRAM
|
config STM32F7_BKPSRAM
|
||||||
bool "Enable BKP RAM Domain"
|
bool "Enable BKP RAM Domain"
|
||||||
|
|||||||
@@ -41,10 +41,6 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
|
||||||
|
|
||||||
#include "chip.h"
|
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,12 @@
|
|||||||
#define ADC_MAX_CHANNELS_DMA 16
|
#define ADC_MAX_CHANNELS_DMA 16
|
||||||
#define ADC_MAX_CHANNELS_NODMA 1
|
#define ADC_MAX_CHANNELS_NODMA 1
|
||||||
|
|
||||||
|
#ifdef ADC_HAVE_DMA
|
||||||
|
# ifndef CONFIG_STM32F7_DMA2
|
||||||
|
# error "STM32F7 ADC DMA support requires CONFIG_STM32F7_DMA2"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ADC_HAVE_DMA
|
#ifdef ADC_HAVE_DMA
|
||||||
# define ADC_MAX_SAMPLES ADC_MAX_CHANNELS_DMA
|
# define ADC_MAX_SAMPLES ADC_MAX_CHANNELS_DMA
|
||||||
#else
|
#else
|
||||||
@@ -1133,7 +1139,7 @@ static void adc_dmaconvcallback(DMA_HANDLE handle, uint8_t isr, FAR void *arg)
|
|||||||
|
|
||||||
for (i = 0; i < priv->nchannels; i++)
|
for (i = 0; i < priv->nchannels; i++)
|
||||||
{
|
{
|
||||||
priv->cb->au_receive(dev, priv->current, priv->dmabuffer[priv->current]);
|
priv->cb->au_receive(dev, priv->chanlist[priv->current], priv->dmabuffer[priv->current]);
|
||||||
priv->current++;
|
priv->current++;
|
||||||
if (priv->current >= priv->nchannels)
|
if (priv->current >= priv->nchannels)
|
||||||
{
|
{
|
||||||
@@ -1721,7 +1727,7 @@ static int adc123_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||||||
* cchannels - Number of channels
|
* cchannels - Number of channels
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Valid ADC device structure reference on succcess; a NULL on failure
|
* Valid ADC device structure reference on success; a NULL on failure
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -750,7 +750,7 @@ extern "C"
|
|||||||
* nchannels - Number of channels
|
* nchannels - Number of channels
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Valid can device structure reference on succcess; a NULL on failure
|
* Valid ADC device structure reference on success; a NULL on failure
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
/* Convert the DMA stream base address to the DMA register block address */
|
/* Convert the DMA stream base address to the DMA register block address */
|
||||||
|
|
||||||
#define DMA_BASE(ch) (ch & 0xfffffc00)
|
#define DMA_BASE(ch) ((ch) & 0xfffffc00)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
|
|||||||
Reference in New Issue
Block a user