diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-11-27 13:05:02 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-11-27 13:05:02 +0000 |
commit | 275154249a7026000e98102dce03e66481a6176f (patch) | |
tree | e92754d1de464d39f39191fc58c41e46836e9b3d | |
parent | ca1f8ac53e4af7c72a36f294fb720a3f63cac34d (diff) | |
download | px4-nuttx-275154249a7026000e98102dce03e66481a6176f.tar.gz px4-nuttx-275154249a7026000e98102dce03e66481a6176f.tar.bz2 px4-nuttx-275154249a7026000e98102dce03e66481a6176f.zip |
Need a cancel method to stop DMA
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2280 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/drivers/mmcsd/mmcsd_sdio.c | 3 | ||||
-rwxr-xr-x | nuttx/include/nuttx/sdio.h | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/nuttx/drivers/mmcsd/mmcsd_sdio.c b/nuttx/drivers/mmcsd/mmcsd_sdio.c index a0db7d76c..9601bdc0f 100644 --- a/nuttx/drivers/mmcsd/mmcsd_sdio.c +++ b/nuttx/drivers/mmcsd/mmcsd_sdio.c @@ -459,6 +459,7 @@ static int mmcsd_getSCR(FAR struct mmcsd_state_s *priv, uint32 scr[2]) if (ret != OK) { fdbg("ERROR: RECVR1 for ACMD51 failed: %d\n", ret); + SDIO_CANCEL(priv->dev); return ret; } @@ -1254,6 +1255,7 @@ static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv, if (ret != OK) { fdbg("ERROR: mmcsd_recvR1 for CMD17 failed: %d\n", ret); + SDIO_CANCEL(priv->dev); return ret; } @@ -1359,6 +1361,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv, if (ret != OK) { fdbg("ERROR: mmcsd_recvR1 for CMD18 failed: %d\n", ret); + SDIO_CANCEL(priv->dev); return ret; } diff --git a/nuttx/include/nuttx/sdio.h b/nuttx/include/nuttx/sdio.h index 92a059abc..7733624d0 100755 --- a/nuttx/include/nuttx/sdio.h +++ b/nuttx/include/nuttx/sdio.h @@ -445,6 +445,25 @@ #define SDIO_SENDSETUP(dev,buffer,nbytes) ((dev)->sendsetup(dev,buffer,nbytes)) /**************************************************************************** + * Name: SDIO_CANCEL + * + * Description: + * Cancel the data transfer setup of SDIO_RECVSETUP, SDIO_SENDSETUP, + * SDIO_DMARECVSETUP or SDIO_DMASENDSETUP. This must be called to cancel + * the data transfer setup if, for some reason, you cannot perform the + * transfer. + * + * Input Parameters: + * dev - An instance of the SDIO device interface + * + * Returned Value: + * OK is success; a negated errno on failure + * + ****************************************************************************/ + +#define SDIO_CANCEL(dev) ((dev)->cancel(dev)) + +/**************************************************************************** * Name: SDIO_WAITRESPONSE * * Description: @@ -708,6 +727,7 @@ struct sdio_dev_s size_t nbytes); int (*sendsetup)(FAR struct sdio_dev_s *dev, FAR const ubyte *buffer, size_t nbytes); + int (*cancel)(FAR struct sdio_dev_s *dev); int (*waitresponse)(FAR struct sdio_dev_s *dev, uint32 cmd); int (*recvR1)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R1); |