diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-01 15:32:39 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-01 15:32:39 +0000 |
commit | 7dba70eeaf6654f9837902db9ac290fd5b4cfed4 (patch) | |
tree | 2e02176b8ca78da4db5ac2181c8bdb95ab8cd2d2 /nuttx/drivers/mmcsd/mmcsd_spi.c | |
parent | 43c642c61857ceefe07ce0fb929c569b52a545a5 (diff) | |
download | px4-nuttx-7dba70eeaf6654f9837902db9ac290fd5b4cfed4.tar.gz px4-nuttx-7dba70eeaf6654f9837902db9ac290fd5b4cfed4.tar.bz2 px4-nuttx-7dba70eeaf6654f9837902db9ac290fd5b4cfed4.zip |
Additional patches from Petteri Aimonen for FAT, STM32 SPI, and AT25
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5593 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/mmcsd/mmcsd_spi.c')
-rw-r--r-- | nuttx/drivers/mmcsd/mmcsd_spi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nuttx/drivers/mmcsd/mmcsd_spi.c b/nuttx/drivers/mmcsd/mmcsd_spi.c index d437b7fea..3d4cf1dd1 100644 --- a/nuttx/drivers/mmcsd/mmcsd_spi.c +++ b/nuttx/drivers/mmcsd/mmcsd_spi.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/mmcsd/mmcsd_spi.c * - * Copyright (C) 2008-2010, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -409,10 +409,14 @@ static uint32_t mmcsd_sendcmd(FAR struct mmcsd_slot_s *slot, int ret; int i; - /* Wait until the card is not busy */ + /* Wait until the card is not busy. Some SD cards will not enter the IDLE + * state until CMD0 is sent for the first time, switching the card to SPI + * mode. Having a pull-up resistor on MISO may avoid this problem, but + * this check makes it work also without the pull-up. + */ ret = mmcsd_waitready(slot); - if (ret != OK) + if (ret != OK && cmd != &g_cmd0) { return ret; } |