mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2024-09-20 09:36:32 -04:00
Move 0-length check to outside of DMA-specific code
This commit is contained in:
parent
c21979066c
commit
7b04012eaf
@ -509,12 +509,13 @@ void Adafruit_SPITFT::writePixels(uint16_t *colors, uint32_t len) {
|
||||
/**************************************************************************/
|
||||
void Adafruit_SPITFT::writeColor(uint16_t color, uint32_t len) {
|
||||
|
||||
if(!len) return; // Avoid 0-byte transfers
|
||||
|
||||
uint8_t hi = color >> 8, lo = color;
|
||||
|
||||
if(_sclk < 0) { // Using hardware SPI
|
||||
|
||||
#ifdef USE_SPI_DMA
|
||||
if(!len) return; // DO NOT ANGER DMA WITH 0-BYTE TRANSFERS!
|
||||
|
||||
int i, d, numDescriptors;
|
||||
if(hi == lo) { // If high & low bytes are same...
|
||||
|
Loading…
Reference in New Issue
Block a user