Skip to content

Commit

Permalink
SPI: writePattern() should not call setDataBits(0) (#8636)
Browse files Browse the repository at this point in the history
resolves #8635
  • Loading branch information
mcspr authored Jul 27, 2022
1 parent 06f34ed commit d44c3f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libraries/SPI/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,11 @@ void SPIClass::writePattern(const uint8_t * data, uint8_t size, uint32_t repeat)
}
}
//End orig
setDataBits(repeatRem * 8);
SPI1CMD |= SPIBUSY;
while(SPI1CMD & SPIBUSY) {}
if (repeatRem) {
setDataBits(repeatRem * 8);
SPI1CMD |= SPIBUSY;
while(SPI1CMD & SPIBUSY) {}
}

SPI1U = SPIUMOSI | SPIUDUPLEX | SPIUSSE;
}
Expand Down

0 comments on commit d44c3f4

Please sign in to comment.