Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/utility/w5100.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,14 @@ uint16_t W5100Class::read(uint16_t addr, uint8_t *buf, uint16_t len)
cmd[1] = addr & 0xFF;
cmd[2] = (len >> 8) & 0x7F;
cmd[3] = len & 0xFF;
#ifdef SPI_HAS_TRANSFER_BUF
SPI.transfer(cmd, NULL, 4);
SPI.transfer(NULL, buf, len);
#else
SPI.transfer(cmd, 4);
memset(buf, 0, len);
SPI.transfer(buf, len);
#endif
resetSS();
} else { // chip == 55
setSS();
Expand Down Expand Up @@ -457,9 +462,14 @@ uint16_t W5100Class::read(uint16_t addr, uint8_t *buf, uint16_t len)
cmd[2] = ((addr >> 6) & 0xE0) | 0x18; // 2K buffers
#endif
}
#ifdef SPI_HAS_TRANSFER_BUF
SPI.transfer(cmd, NULL, 3);
SPI.transfer(NULL, buf, len);
#else
SPI.transfer(cmd, 3);
memset(buf, 0, len);
SPI.transfer(buf, len);
#endif
resetSS();
}
return len;
Expand Down