From 12f9ce8691953b25c694398ca6c4ce96ba32e16f Mon Sep 17 00:00:00 2001 From: Bodmer Date: Sat, 4 Dec 2021 16:36:31 +0000 Subject: [PATCH] Update Read_User_Setup example for RP2040 --- TFT_eSPI.h | 2 +- .../Read_User_Setup/Read_User_Setup.ino | 17 +++++------------ library.json | 2 +- library.properties | 2 +- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/TFT_eSPI.h b/TFT_eSPI.h index dcacf12..e898860 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -16,7 +16,7 @@ #ifndef _TFT_eSPIH_ #define _TFT_eSPIH_ -#define TFT_ESPI_VERSION "2.3.84" +#define TFT_ESPI_VERSION "2.3.85" // Bit level feature flags // Bit 0 set: viewport capability diff --git a/examples/Test and diagnostics/Read_User_Setup/Read_User_Setup.ino b/examples/Test and diagnostics/Read_User_Setup/Read_User_Setup.ino index 7530051..4559d10 100644 --- a/examples/Test and diagnostics/Read_User_Setup/Read_User_Setup.ino +++ b/examples/Test and diagnostics/Read_User_Setup/Read_User_Setup.ino @@ -74,15 +74,9 @@ if (user.r2_y_offset != 0) { Serial.print("R2 y offset = "); Serial.println(us if (user.r3_x_offset != 0) { Serial.print("R3 x offset = "); Serial.println(user.r3_x_offset); } if (user.r3_y_offset != 0) { Serial.print("R3 y offset = "); Serial.println(user.r3_y_offset); } -#ifdef ESP32 - if (user.pin_tft_mosi != -1) { Serial.print("MOSI = "); Serial.print("GPIO "); Serial.println(user.pin_tft_mosi); } - if (user.pin_tft_miso != -1) { Serial.print("MISO = "); Serial.print("GPIO "); Serial.println(user.pin_tft_miso); } - if (user.pin_tft_clk != -1) { Serial.print("SCK = "); Serial.print("GPIO "); Serial.println(user.pin_tft_clk); } -#else - if (user.pin_tft_mosi != -1) { Serial.print("MOSI = "); Serial.print("GPIO "); Serial.print(getPinName(user.pin_tft_mosi)); Serial.println(user.pin_tft_mosi); } - if (user.pin_tft_miso != -1) { Serial.print("MISO = "); Serial.print("GPIO "); Serial.print(getPinName(user.pin_tft_miso)); Serial.println(user.pin_tft_miso); } - if (user.pin_tft_clk != -1) { Serial.print("SCK = "); Serial.print("GPIO "); Serial.print(getPinName(user.pin_tft_clk)); Serial.println(user.pin_tft_clk); } -#endif +if (user.pin_tft_mosi != -1) { Serial.print("MOSI = "); Serial.print("GPIO "); Serial.println(getPinName(user.pin_tft_mosi)); } +if (user.pin_tft_miso != -1) { Serial.print("MISO = "); Serial.print("GPIO "); Serial.println(getPinName(user.pin_tft_miso)); } +if (user.pin_tft_clk != -1) { Serial.print("SCK = "); Serial.print("GPIO "); Serial.println(getPinName(user.pin_tft_clk)); } #ifdef ESP8266 if (user.overlap == true) @@ -150,8 +144,7 @@ if (user.pin_tch_cs != -1) { Serial.print("Touch SPI frequency = "); Serial.pr Serial.println("[/code]"); -while(1) yield(); - +delay(3000); } void printProcessorName(void) @@ -167,7 +160,7 @@ void printProcessorName(void) int8_t getPinName(int8_t pin) { // For ESP32 pin labels on boards use the GPIO number - if (user.esp == 0x32) return pin; + if (user.esp == 0x32 || user.esp == 0x2040) return pin; if (user.esp == 0x8266) { // For ESP8266 the pin labels are not the same as the GPIO number diff --git a/library.json b/library.json index 9714763..617eacb 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TFT_eSPI", - "version": "2.3.84", + "version": "2.3.85", "keywords": "Arduino, tft, ePaper, display, Pico, RP2040, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9481, ILI9486, ILI9488, ST7789, RM68140, SSD1351, SSD1963, ILI9225, HX8357D", "description": "A TFT and ePaper SPI graphics library with optimisation for Raspberry Pi Pico, ESP8266, ESP32 and STM32", "repository": diff --git a/library.properties b/library.properties index f6450ce..74f8da5 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TFT_eSPI -version=2.3.84 +version=2.3.85 author=Bodmer maintainer=Bodmer sentence=TFT graphics library for Arduino processors with performance optimisation for RP2040, STM32, ESP8266 and ESP32