Merge pull request #9164 from GMagician/1.1.x-SD-issues-fix
[1.1.x] sd issue fix
This commit is contained in:
commit
1d8b03964f
1 changed files with 6 additions and 5 deletions
|
@ -405,21 +405,22 @@ bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) {
|
||||||
else if (readData(dst, 512))
|
else if (readData(dst, 512))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
chipSelectHigh();
|
||||||
if (!--retryCnt) break;
|
if (!--retryCnt) break;
|
||||||
|
|
||||||
chipSelectHigh();
|
|
||||||
cardCommand(CMD12, 0); // Try sending a stop command, ignore the result.
|
cardCommand(CMD12, 0); // Try sending a stop command, ignore the result.
|
||||||
errorCode_ = 0;
|
errorCode_ = 0;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
#else
|
#else
|
||||||
if (cardCommand(CMD17, blockNumber))
|
if (cardCommand(CMD17, blockNumber)) {
|
||||||
error(SD_CARD_ERROR_CMD17);
|
error(SD_CARD_ERROR_CMD17);
|
||||||
|
chipSelectHigh();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return readData(dst, 512);
|
return readData(dst, 512);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
chipSelectHigh();
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue