From 49ebdf437bd18d8ea45f5aa18e7a6ae1f1974401 Mon Sep 17 00:00:00 2001 From: gsoros Date: Thu, 21 May 2026 03:13:53 +0200 Subject: [PATCH] Update SPI_PORT logic for ESP32C3 and legacy ESP32 support --- .gitignore | 2 ++ Processors/TFT_eSPI_ESP32_C3.h | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 55bda4cba..1c1ca3911 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.vscode/ + # Windows image file caches Thumbs.db ehthumbs.db diff --git a/Processors/TFT_eSPI_ESP32_C3.h b/Processors/TFT_eSPI_ESP32_C3.h index 3ac66992c..19dd26ba3 100644 --- a/Processors/TFT_eSPI_ESP32_C3.h +++ b/Processors/TFT_eSPI_ESP32_C3.h @@ -64,10 +64,14 @@ SPI2_HOST = 1, ///< actually SPI1 SPI3_HOST = 2, ///< actually SPI2 */ -#if ESP_ARDUINO_VERSION_MAJOR < 3 -#define SPI_PORT SPI2_HOST +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C5 || \ + CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 || \ + CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 + #define SPI_PORT 2 // SPI3_HOST = actually SPI2 hw, only one available +#elif ESP_ARDUINO_VERSION_MAJOR < 3 + #define SPI_PORT SPI2_HOST // legacy ESP32 classic #else -#define SPI_PORT 2 + #define SPI_PORT 2 #endif #ifdef RPI_DISPLAY_TYPE