Add delay to avoid resets

Per discussion in #6, this adds a `delay(0)` call to avoid watchdog timer resets in the ESP8266 when not using the SPI hardware pins.
This commit is contained in:
André David 2018-06-19 23:58:22 +02:00 committed by GitHub
parent 47c83e929a
commit 521daecd91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,6 +128,9 @@ void testlines(uint16_t color) {
display.drawLine(display.width()-1, 0, 0, y, color); display.drawLine(display.width()-1, 0, 0, y, color);
} }
// To avoid ESP8266 watchdog timer resets when not using the hardware SPI pins
delay(0);
display.fillScreen(BLACK); display.fillScreen(BLACK);
for (int16_t x=0; x < display.width()-1; x+=6) { for (int16_t x=0; x < display.width()-1; x+=6) {
display.drawLine(0, display.height()-1, x, 0, color); display.drawLine(0, display.height()-1, x, 0, color);