Should not wait for card to be ready when sending stop command

pull/7774/head
Deepika 2017-08-29 13:14:56 -05:00
parent 6b10f286f5
commit d4d1d87bf8
1 changed files with 10 additions and 7 deletions

View File

@ -689,8 +689,12 @@ int SDBlockDevice::_cmd(SDBlockDevice::cmdSupported cmd, uint32_t arg, bool isAc
// Select card and wait for card to be ready before sending next command // Select card and wait for card to be ready before sending next command
// Note: next command will fail if card is not ready // Note: next command will fail if card is not ready
_select(); _select();
if (false == _wait_ready(SD_COMMAND_TIMEOUT)) {
debug_if(SD_DBG, "Card not ready yet \n"); // No need to wait for card to be ready when sending the stop command
if (CMD12_STOP_TRANSMISSION != cmd) {
if (false == _wait_ready(SD_COMMAND_TIMEOUT)) {
debug_if(SD_DBG, "Card not ready yet \n");
}
} }
// Re-try command // Re-try command
@ -698,11 +702,10 @@ int SDBlockDevice::_cmd(SDBlockDevice::cmdSupported cmd, uint32_t arg, bool isAc
// Send CMD55 for APP command first // Send CMD55 for APP command first
if (isAcmd) { if (isAcmd) {
response = _cmd_spi(CMD55_APP_CMD, 0x0); response = _cmd_spi(CMD55_APP_CMD, 0x0);
} // Wait for card to be ready after CMD55
if (false == _wait_ready(SD_COMMAND_TIMEOUT)) {
// Wait for card to be ready after CMD55 debug_if(SD_DBG, "Card not ready yet \n");
if (false == _wait_ready(SD_COMMAND_TIMEOUT)) { }
debug_if(SD_DBG, "Card not ready yet \n");
} }
// Send command over SPI interface // Send command over SPI interface