summaryrefslogtreecommitdiff
path: root/nuttx/drivers/mmcsd/mmcsd_sdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/drivers/mmcsd/mmcsd_sdio.c')
-rwxr-xr-x[-rw-r--r--]nuttx/drivers/mmcsd/mmcsd_sdio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nuttx/drivers/mmcsd/mmcsd_sdio.c b/nuttx/drivers/mmcsd/mmcsd_sdio.c
index e208a8aca..3c1fd9bdc 100644..100755
--- a/nuttx/drivers/mmcsd/mmcsd_sdio.c
+++ b/nuttx/drivers/mmcsd/mmcsd_sdio.c
@@ -1150,6 +1150,15 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv)
* the TRANSFER state when the card completes the WRITE operation.
*/
+#if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE)
+ ret = mmcsd_eventwait(priv, SDIOWAIT_TIMEOUT|SDIOWAIT_ERROR,
+ MMCSD_BLOCK_WDATADELAY);
+ if (ret != OK)
+ {
+ fdbg("ERROR: mmcsd_eventwait for transfer ready failed: %d\n", ret);
+ }
+#endif
+
starttime = clock_systimer();
do
{
@@ -1721,6 +1730,12 @@ static ssize_t mmcsd_writesingle(FAR struct mmcsd_state_s *priv,
return ret;
}
+#if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE)
+ /* Arm the write complete detection with timeout */
+
+ SDIO_WAITENABLE(priv->dev, SDIOWAIT_WRCOMPLETE|SDIOWAIT_TIMEOUT);
+#endif
+
/* On success, return the number of blocks written */
return 1;