Skip to content
Merged
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
5 changes: 3 additions & 2 deletions libraries/SPI/src/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ void SPIClass::writePattern(uint8_t * data, uint8_t size, uint32_t repeat)

uint32_t byte = (size * repeat);
uint8_t r = (64 / size);
const uint8_t max_bytes_FIFO = r * size; // Max number of whole patterns (in bytes) that can fit into the hardware FIFO

while(byte) {
if(byte > 64) {
if(byte > max_bytes_FIFO) {
writePattern_(data, size, r);
byte -= 64;
byte -= max_bytes_FIFO;
} else {
writePattern_(data, size, (byte / size));
byte = 0;
Expand Down