Faster writePixels for ESP8266 with hardware SPI

Similar to what is done for ESP32 and NRF52 chips, use the builtin multi-byte methods for writing pixels over SPI.
This commit is contained in:
John Boiles authored and GitHub committed 2021-11-05 21:25:28 -07:00
1 parent 223f914d0e
commit 777c60792a
1 file changed
+11
+11
View File
@@ -1011,6 +1011,17 @@ void Adafruit_SPITFT::writePixels(uint16_t *colors, uint32_t len, bool block,
}
return;
}
#elif defined(ESP8266)
if (connection == TFT_HARD_SPI) {
if (!bigEndian) {
swapBytes(colors, len); // convert little-to-big endian for display
}
hwspi._spi->writeBytes((uint8_t *)colors, len * 2);
if (!bigEndian) {
swapBytes(colors, len); // big-to-little endian to restore pixel buffer
}
return;
}
#elif defined(ARDUINO_NRF52_ADAFRUIT) && \
defined(NRF52840_XXAA) // Adafruit nRF52 use SPIM3 DMA at 32Mhz
if (!bigEndian) {