adafruit / Adafruit_ILI9341

Library for Adafruit ILI9341 displays
408 stars 283 forks source link

Screenfill ESP8266 very slow #39

Closed PaulChristopher closed 6 years ago

PaulChristopher commented 6 years ago

See test case attached: Using the latest version of this repo (commit 136173b61e20a164aa99be9337d7ab311a14be7b) and hardware SPI, clearing the screen with a certain color takes 319ms on an ESP8266 (WEMOS D1 mini). The Arduino MEGA 2560 does it in 289ms, the ESP32 (DOIT ESP32 DEVKIT V1) does it in 32 ms.

Don't know what's wrong with this. Using a comparable library based on the Adafruit library, the screenfill takes only 33ms on the ESP8266.

Don't know whether this also happens with Adafruit hardware. Just wanted to let you know...

Keep up the brilliant work and all the best! P.

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// Pin settings EPS8266
//#define TFT_CS   SS
//#define TFT_DC   4
//#define TFT_RST  5

// Pin settings EPS32
//#define TFT_CS   SS
//#define TFT_DC   15
//#define TFT_RST  2

// Pin settings Arduino MEGA 2560
#define TFT_CS   SS
#define TFT_DC   7
#define TFT_RST  6

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  #ifdef ESP8266
    Serial.begin(74880);
  #else
    Serial.begin(115200);
  #endif

  tft.begin();

  unsigned long t = millis();
  tft.fillScreen(ILI9341_BLUE);
  Serial.println(millis()-t);
}

void loop() {
  delay(1000);
}
ladyada commented 6 years ago

hiya just closing some old open PR's we've updated the library to be based off of Adafruit_SPITFT which abstracts the SPI stuff away and should be much faster now!