File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -106,18 +106,6 @@ void spiSend(uint8_t data) {
106
106
sei ();
107
107
}
108
108
#endif // SOFTWARE_SPI
109
-
110
- void spiRec (uint8_t * data, int size) {
111
- #ifdef USE_SPI_LIB
112
- SDCARD_SPI.transfer (data, size);
113
- #else
114
- while (size) {
115
- *data++ = spiRec ();
116
- size--;
117
- }
118
- #endif
119
- }
120
-
121
109
// ------------------------------------------------------------------------------
122
110
// send command and return error code. Return zero for OK
123
111
uint8_t Sd2Card::cardCommand (uint8_t cmd, uint32_t arg) {
@@ -442,7 +430,9 @@ uint8_t Sd2Card::readData(uint32_t block,
442
430
spiRec ();
443
431
}
444
432
// transfer data
445
- spiRec (dst, count);
433
+ for (uint16_t i = 0 ; i < count; i++) {
434
+ dst[i] = spiRec ();
435
+ }
446
436
#endif // OPTIMIZE_HARDWARE_SPI
447
437
448
438
offset_ += count;
@@ -489,7 +479,7 @@ uint8_t Sd2Card::readRegister(uint8_t cmd, void* buf) {
489
479
}
490
480
if (!waitStartBlock ()) goto fail;
491
481
// transfer data
492
- spiRec (dst, 16 );
482
+ for ( uint16_t i = 0 ; i < 16 ; i++) dst[i] = spiRec ( );
493
483
spiRec (); // get first crc byte
494
484
spiRec (); // get second crc byte
495
485
chipSelectHigh ();
You can’t perform that action at this time.
0 commit comments