Skip to content

Commit 5276487

Browse files
authored
Merge pull request #2 from vshymanskyy/revert-1-SPI_HAS_TRANSFER_BUF-for-read
Revert "use transfer(wbuf,rbuf,count) also for read"
2 parents daac848 + 9e7b1df commit 5276487

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/utility/w5100.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,9 @@ uint16_t W5100Class::read(uint16_t addr, uint8_t *buf, uint16_t len)
413413
cmd[1] = addr & 0xFF;
414414
cmd[2] = (len >> 8) & 0x7F;
415415
cmd[3] = len & 0xFF;
416-
#ifdef SPI_HAS_TRANSFER_BUF
417-
SPI.transfer(cmd, NULL, 4);
418-
SPI.transfer(NULL, buf, len);
419-
#else
420416
SPI.transfer(cmd, 4);
421417
memset(buf, 0, len);
422418
SPI.transfer(buf, len);
423-
#endif
424419
resetSS();
425420
} else { // chip == 55
426421
setSS();
@@ -462,14 +457,9 @@ uint16_t W5100Class::read(uint16_t addr, uint8_t *buf, uint16_t len)
462457
cmd[2] = ((addr >> 6) & 0xE0) | 0x18; // 2K buffers
463458
#endif
464459
}
465-
#ifdef SPI_HAS_TRANSFER_BUF
466-
SPI.transfer(cmd, NULL, 3);
467-
SPI.transfer(NULL, buf, len);
468-
#else
469460
SPI.transfer(cmd, 3);
470461
memset(buf, 0, len);
471462
SPI.transfer(buf, len);
472-
#endif
473463
resetSS();
474464
}
475465
return len;

0 commit comments

Comments
 (0)