Work around for D4 IDE bug

A condition can exist where pin D4 is allocated a value of 0
The workaround is to define and use pin numbers in the PIN_Dx format
This commit is contained in:
Bodmer 2017-04-14 15:45:40 +01:00
parent d31cbc3dbd
commit 6526e34e7c
12 changed files with 54 additions and 87 deletions

View File

@ -21,9 +21,9 @@
#include <pgmspace.h>
#include <limits.h>
#include "pins_arduino.h"
#include "wiring_private.h"
//#include <limits.h>
//#include "pins_arduino.h"
//#include "wiring_private.h"
#include <SPI.h>
// If it is a 16bit serial display we must transfer 16 bits every time

View File

@ -75,13 +75,14 @@
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
// ModeMCU
#define TFT_CS D8 // Chip select control pin D8
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
// ModeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
#define TFT_CS PIN_D8 // Chip select control pin D8
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
//#define TFT_WR D2 // Write strobe for modified Raspberry Pi TFT only
//#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only
// ESP32 Dev board (planned, not supported yet)
//#define TFT_CS 5 // Chip select control pin
@ -125,14 +126,10 @@
// ##################################################################################
//
// Section 4. Define Dx pin allocations if needed
// Section 4. Not used
//
// ##################################################################################
// Some board selections do not include the Dx format of the NodeMCU so
// uncomment the next line to ensure they are defined.
// #define DEFINE_DX_PINS
// ##################################################################################
//

View File

@ -50,17 +50,15 @@
#include <TFT_Drivers/RPI_ILI9486_Defines.h>
#endif
// Define the pins if needed (See Section 4 of User_Setup.h)
#ifdef DEFINE_DX_PINS
#define D0 16
#define D1 5
#define D2 4
#define D3 0
#define D4 2
#define D5 14
#define D6 12
#define D7 13
#define D8 15
#define D9 3
#define D10 1
#endif
// These are the pins for all ESP8266 boards
#define PIN_D0 16
#define PIN_D1 5
#define PIN_D2 4
#define PIN_D3 0
#define PIN_D4 2
#define PIN_D5 14
#define PIN_D6 12
#define PIN_D7 13
#define PIN_D8 15
#define PIN_D9 3
#define PIN_D10 1

View File

@ -67,9 +67,9 @@
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
// ModeMCU
#define TFT_CS D8 // Chip select control pin D8
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
#define TFT_CS PIN_D8 // Chip select control pin D8
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
// ESP32 Dev board (planned, not supported yet)
@ -114,14 +114,10 @@
// ##################################################################################
//
// Section 4. Define Dx pin allocations if needed
// Section 4. Not used
//
// ##################################################################################
// Some board selections do not include the Dx format of the NodeMCU so
// uncomment the next line to ensure they are defined.
// #define DEFINE_DX_PINS
// ##################################################################################
//

View File

@ -73,9 +73,9 @@
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
// ModeMCU
#define TFT_CS D8 // Chip select control pin D8
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
#define TFT_CS PIN_D8 // Chip select control pin D8
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
// ESP32 Dev board (planned, not test/supported yet)
@ -120,14 +120,10 @@
// ##################################################################################
//
// Section 4. Define Dx pin allocations if needed
// Section 4. Not used
//
// ##################################################################################
// Some board selections do not include the Dx format of the NodeMCU so
// uncomment the next line to ensure they are defined.
// #define DEFINE_DX_PINS
// ##################################################################################
//

View File

@ -56,9 +56,9 @@
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
// ModeMCU
#define TFT_CS D8 // Chip select control pin D8
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
#define TFT_CS PIN_D8 // Chip select control pin D8
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
// ESP32 Dev board (planned, not supported yet)
@ -103,14 +103,10 @@
// ##################################################################################
//
// Section 4. Define Dx pin allocations if needed
// Section 4. Not used
//
// ##################################################################################
// Some board selections do not include the Dx format of the NodeMCU so
// uncomment the next line to ensure they are defined.
// #define DEFINE_DX_PINS
// ##################################################################################
//

View File

@ -56,9 +56,9 @@
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
// ModeMCU
#define TFT_CS D8 // Chip select control pin D8
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
#define TFT_CS PIN_D8 // Chip select control pin D8
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
// ESP32 Dev board (planned, not supported yet)
@ -103,14 +103,10 @@
// ##################################################################################
//
// Section 4. Define Dx pin allocations if needed
// Section 4. Not used
//
// ##################################################################################
// Some board selections do not include the Dx format of the NodeMCU so
// uncomment the next line to ensure they are defined.
// #define DEFINE_DX_PINS
// ##################################################################################
//

View File

@ -76,12 +76,12 @@
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
// ModeMCU
#define TFT_CS D8 // Chip select control pin D8
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
#define TFT_CS PIN_D8 // Chip select control pin D8
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
//#define TFT_WR D2 // Write strobe for modified Raspberry Pi TFT only
//#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only
// ESP32 Dev board (planned, not supported yet)
//#define TFT_CS 5 // Chip select control pin
@ -125,14 +125,10 @@
// ##################################################################################
//
// Section 4. Define Dx pin allocations if needed
// Section 4. Not used
//
// ##################################################################################
// Some board selections do not include the Dx format of the NodeMCU so
// uncomment the next line to ensure they are defined.
// #define DEFINE_DX_PINS
// ##################################################################################
//

View File

@ -76,12 +76,12 @@
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
// ModeMCU
#define TFT_CS D8 // Chip select control pin D8
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
#define TFT_CS PIN_D8 // Chip select control pin D8
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
#define TFT_WR D2 // Write strobe for modified Raspberry Pi TFT only
#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only
// ESP32 Dev board (planned, not supported yet)
//#define TFT_CS 5 // Chip select control pin
@ -125,14 +125,10 @@
// ##################################################################################
//
// Section 4. Define Dx pin allocations if needed
// Section 4. Not used
//
// ##################################################################################
// Some board selections do not include the Dx format of the NodeMCU so
// uncomment the next line to ensure they are defined.
// #define DEFINE_DX_PINS
// ##################################################################################
//

View File

@ -74,9 +74,9 @@
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
// ModeMCU
#define TFT_CS D8 // Chip select control pin D8
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
#define TFT_CS PIN_D8 // Chip select control pin D8
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
// ESP32 Dev board (planned, not supported yet)
@ -121,14 +121,10 @@
// ##################################################################################
//
// Section 4. Define Dx pin allocations if needed
// Section 4. Not used
//
// ##################################################################################
// Some board selections do not include the Dx format of the NodeMCU so
// uncomment the next line to ensure they are defined.
// #define DEFINE_DX_PINS
// ##################################################################################
//

View File

@ -1,6 +1,6 @@
{
"name": "TFT_eSPI",
"version": "0.16.2",
"version": "0.16.3",
"keywords": "ILI9341, ST7735, ESP8266, TFT",
"description": "A TFT SPI graphics library for ESP8266",
"repository":

View File

@ -1,5 +1,5 @@
name=TFT_eSPI
version=0.16.2
version=0.16.3
author=Bodmer
maintainer=Bodmer
sentence=A fast TFT library for ESP8266 processors and the Arduino IDE