diff --git a/User_Setup.h b/User_Setup.h index 41bdf10..62e6ff0 100644 --- a/User_Setup.h +++ b/User_Setup.h @@ -99,6 +99,9 @@ //#define TFT_CS 15 // Chip select control pin //#define TFT_DC 2 // Data Command control pin //#define TFT_RST 4 // Reset pin (could connect to RST pin) +//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST + +//#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen //#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only @@ -162,7 +165,7 @@ // #define SPI_FREQUENCY 40000000 // Maximum to use SPIFFS // #define SPI_FREQUENCY 80000000 -#define SPI_TOUCH_FREQUENCY 2500000 +// #define SPI_TOUCH_FREQUENCY 2500000 // Comment out the following #define if "SPI Transactions" do not need to be diff --git a/User_Setup_Select.h b/User_Setup_Select.h index 3d8c600..8129612 100644 --- a/User_Setup_Select.h +++ b/User_Setup_Select.h @@ -27,6 +27,7 @@ //#include // Setup file configured for my ST7735 128x128 display //#include // Setup file configured for my ILI9163 128x128 display //#include // Setup file configured for my ST7735 +//#include // Setup file configured for my stock RPi TFT with touch //#include // Setup file template for copying/editting diff --git a/examples/160 x 128/TFT_flash_jpg/TFT_flash_jpg.ino b/examples/160 x 128/TFT_flash_jpg/TFT_flash_jpg.ino index 4da9af4..7d0f662 100644 --- a/examples/160 x 128/TFT_flash_jpg/TFT_flash_jpg.ino +++ b/examples/160 x 128/TFT_flash_jpg/TFT_flash_jpg.ino @@ -130,32 +130,12 @@ void renderJPEG(int xpos, int ypos) { int mcu_x = JpegDec.MCUx * mcu_w + xpos; // Calculate coordinates of top left corner of current MCU int mcu_y = JpegDec.MCUy * mcu_h + ypos; - - // check if the image block size needs to be changed for the right edge + // check if the image block size needs to be changed for the right and bottom edges if (mcu_x + mcu_w <= max_x) win_w = mcu_w; else win_w = min_w; - - // check if the image block size needs to be changed for the bottom edge if (mcu_y + mcu_h <= max_y) win_h = mcu_h; else win_h = min_h; - // copy pixels into a contiguous block - if (win_w != mcu_w) - { - uint16_t *cImg; - int p = 0; - cImg = pImg + win_w; - for (int h = 1; h < win_h; h++) - { - p += mcu_w; - for (int w = 0; w < win_w; w++) - { - *cImg = *(pImg + w + p); - cImg++; - } - } - } - // draw image MCU block only if it will fit on the screen if (( mcu_x + win_w ) <= tft.width() && ( mcu_y + win_h ) <= tft.height()) { diff --git a/examples/480 x 320/TFT_flash_jpg/TFT_flash_jpg.ino b/examples/480 x 320/TFT_flash_jpg/TFT_flash_jpg.ino index b3d7b96..5af0f13 100644 --- a/examples/480 x 320/TFT_flash_jpg/TFT_flash_jpg.ino +++ b/examples/480 x 320/TFT_flash_jpg/TFT_flash_jpg.ino @@ -23,9 +23,6 @@ TFT_eSPI tft = TFT_eSPI(); // JPEG decoder library #include -// Chip Select Pin for SD card -#define SD_CS 53 - // Return the minimum of two values a and b #define minimum(a,b) (((a) < (b)) ? (a) : (b))