Sfoglia il codice sorgente

Save some program memory

This will save some program memory with no speed lose
GMagician 6 anni fa
parent
commit
be717b3c07
1 ha cambiato i file con 6 aggiunte e 5 eliminazioni
  1. 6
    5
      Marlin/src/sd/Sd2Card.cpp

+ 6
- 5
Marlin/src/sd/Sd2Card.cpp Vedi File

339
       else if (readData(dst, 512))
339
       else if (readData(dst, 512))
340
         return true;
340
         return true;
341
 
341
 
342
+      chipDeselect();
342
       if (!--retryCnt) break;
343
       if (!--retryCnt) break;
343
 
344
 
344
-      chipDeselect();
345
       cardCommand(CMD12, 0); // Try sending a stop command, ignore the result.
345
       cardCommand(CMD12, 0); // Try sending a stop command, ignore the result.
346
       errorCode_ = 0;
346
       errorCode_ = 0;
347
     }
347
     }
348
+  return false;
348
   #else
349
   #else
349
-    if (cardCommand(CMD17, blockNumber))
350
+    if (cardCommand(CMD17, blockNumber)) {
350
       error(SD_CARD_ERROR_CMD17);
351
       error(SD_CARD_ERROR_CMD17);
352
+      chipDeselect();
353
+      return false;
354
+    }
351
     else
355
     else
352
       return readData(dst, 512);
356
       return readData(dst, 512);
353
   #endif
357
   #endif
354
-
355
-  chipDeselect();
356
-  return false;
357
 }
358
 }
358
 
359
 
359
 /**
360
 /**

Loading…
Annulla
Salva