mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
drvers/mmcsd/sdio: function enable should wait for CCCR_IORDY
1. function enable should wait for CCCR_IORDY 2. enlarge wait timeout from 10ms to 1s Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
4e5d8aca3d
commit
7e1f906b74
@@ -30,6 +30,7 @@
|
|||||||
#include <nuttx/compiler.h>
|
#include <nuttx/compiler.h>
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/sdio.h>
|
#include <nuttx/sdio.h>
|
||||||
|
#include <nuttx/signal.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -460,15 +461,15 @@ int sdio_enable_function(FAR struct sdio_dev_s *dev, uint8_t function)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait 10ms for function to be enabled */
|
/* Wait 1s for function to be enabled */
|
||||||
|
|
||||||
int loops = 10;
|
int loops = 100;
|
||||||
|
|
||||||
while (loops-- > 0)
|
while (loops-- > 0)
|
||||||
{
|
{
|
||||||
up_mdelay(1);
|
nxsig_usleep(10 * 1000);
|
||||||
|
|
||||||
ret = sdio_io_rw_direct(dev, false, 0, SDIO_CCCR_IOEN, 0, &value);
|
ret = sdio_io_rw_direct(dev, false, 0, SDIO_CCCR_IORDY, 0, &value);
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
{
|
{
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user