mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2026-10-26 22:10:52 +00:00
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:
1 parent
223f914d0e
commit
777c60792a
1 file changed
+11
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user