forked from nuttx/nuttx-update
mmcsd_sdio:Limit the use of sleep in mmcsd.
reference:https://github.com/apache/nuttx/pull/12971 Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
parent
0e13ea9ed1
commit
44351959ee
1 changed files with 16 additions and 12 deletions
|
@ -98,18 +98,22 @@
|
|||
|
||||
#define MMCSD_CAPACITY(b, s) ((s) >= 10 ? (b) << ((s) - 10) : (b) >> (10 - (s)))
|
||||
|
||||
#define MMCSD_USLEEP(usec) \
|
||||
do \
|
||||
{ \
|
||||
if (up_interrupt_context()) \
|
||||
{ \
|
||||
up_udelay(usec); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
nxsig_usleep(usec); \
|
||||
} \
|
||||
} while (0)
|
||||
#ifdef CONFIG_BOARD_COREDUMP_BLKDEV
|
||||
# define MMCSD_USLEEP(usec) \
|
||||
do \
|
||||
{ \
|
||||
if (up_interrupt_context()) \
|
||||
{ \
|
||||
up_udelay(usec); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
nxsig_usleep(usec); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
# define MMCSD_USLEEP(usec) nxsig_usleep(usec)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
|
|
Loading…
Reference in a new issue