1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-04 18:03:20 +03:00

SPI: writePattern() should not call setDataBits(0) (#8636)

resolves #8635
This commit is contained in:
Max Prokhorov 2022-07-28 00:03:01 +03:00 committed by GitHub
parent 06f34ed566
commit d44c3f42a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}