Skip to content

Commit 5f38af1

Browse files
Don’t use DMA on very short pixel runs
1 parent 4c7192b commit 5f38af1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Adafruit_SPITFT.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,8 @@ void Adafruit_SPITFT::writeColor(uint16_t color, uint32_t len) {
10051005
}
10061006
#else // !ESP32
10071007
#if defined(USE_SPI_DMA)
1008-
if((connection == TFT_HARD_SPI) || (connection == TFT_PARALLEL)) {
1008+
if(((connection == TFT_HARD_SPI) || (connection == TFT_PARALLEL)) &&
1009+
(len >= 16)) { // DMA setup takes longer on short pixel runs
10091010
int i, d, numDescriptors;
10101011
if(hi == lo) { // If high & low bytes are same...
10111012
onePixelBuf = color;

0 commit comments

Comments
 (0)