|
@@ -41,6 +41,8 @@
|
41
|
41
|
#include "../Marlin.h"
|
42
|
42
|
|
43
|
43
|
#if ENABLED(SD_CHECK_AND_RETRY)
|
|
44
|
+ static bool crcSupported = true;
|
|
45
|
+
|
44
|
46
|
#ifdef FAST_CRC
|
45
|
47
|
static const uint8_t crctab7[] PROGMEM = {
|
46
|
48
|
0x00,0x09,0x12,0x1b,0x24,0x2d,0x36,0x3f,0x48,0x41,0x5a,0x53,0x6c,0x65,0x7e,0x77,
|
|
@@ -267,10 +269,7 @@ bool Sd2Card::init(uint8_t sckRateID, pin_t chipSelectPin) {
|
267
|
269
|
}
|
268
|
270
|
|
269
|
271
|
#if ENABLED(SD_CHECK_AND_RETRY)
|
270
|
|
- if (cardCommand( CMD59, 1 ) != R1_IDLE_STATE) {
|
271
|
|
- error(SD_CARD_ERROR_CMD59);
|
272
|
|
- goto FAIL;
|
273
|
|
- }
|
|
272
|
+ crcSupported = (cardCommand(CMD59, 1) == R1_IDLE_STATE);
|
274
|
273
|
#endif
|
275
|
274
|
|
276
|
275
|
// check SD version
|
|
@@ -450,7 +449,7 @@ bool Sd2Card::readData(uint8_t* dst, uint16_t count) {
|
450
|
449
|
#if ENABLED(SD_CHECK_AND_RETRY)
|
451
|
450
|
{
|
452
|
451
|
uint16_t recvCrc = (spiRec() << 8) | spiRec();
|
453
|
|
- if (recvCrc != CRC_CCITT(dst, count)) {
|
|
452
|
+ if (crcSupported && recvCrc != CRC_CCITT(dst, count)) {
|
454
|
453
|
error(SD_CARD_ERROR_READ_CRC);
|
455
|
454
|
goto FAIL;
|
456
|
455
|
}
|