From 0ee62e597bcb877f3c4b2c4a2e8d0197d0ee51cf Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:44:47 +0100 Subject: [PATCH] Fix spi c2 c6 bus numbers and SPI Reg Base defines (#19988) * C2 and C6 have same SPI bus as C3 * Update esp32x_fixes.h * Release Platforms --- include/esp32x_fixes.h | 31 ++++--------------------------- platformio_tasmota32.ini | 4 ++-- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/include/esp32x_fixes.h b/include/esp32x_fixes.h index 13860477a..fe3e57cd6 100644 --- a/include/esp32x_fixes.h +++ b/include/esp32x_fixes.h @@ -58,38 +58,15 @@ #define FSPI_HOST SPI2_HOST #define HSPI_HOST SPI3_HOST #define VSPI_HOST SPI3_HOST -#ifndef REG_SPI_BASE -#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 ))) -// SPI_MOSI_DLEN_REG is not defined anymore in esp32s3, instead use SPI_MS_DLEN_REG +// SPI_MOSI_DLEN_REG is not defined anymore in esp32s3 #define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x) -#endif // REG_SPI_BASE -#elif CONFIG_IDF_TARGET_ESP32C3 +#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 #define SPI_HOST SPI1_HOST #define HSPI_HOST SPI2_HOST -#define VSPI_HOST SPI2_HOST /* No SPI3_host on C3 */ -#if ESP_IDF_VERSION_MAJOR < 5 -// fix a bug in esp-idf 4.4 for esp32c3 -#ifndef REG_SPI_BASE -#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 ))) -// SPI_MOSI_DLEN_REG is not defined anymore in esp32c3, instead use SPI_MS_DLEN_REG -#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x) -#endif // REG_SPI_BASE -#endif //ESP_IDF_VERSION_MAJOR < 5 - -#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6 -#define SPI_HOST SPI1_HOST -#define HSPI_HOST SPI1_HOST /* No SPI2_host on C2/C6 */ -#define VSPI_HOST SPI1_HOST /* No SPI3_host on C2/C6 */ +#define VSPI_HOST SPI2_HOST /* No SPI3_host on C2/C6 */ #define VSPI SPI -// #if ESP_IDF_VERSION_MAJOR < 5 -// // fix a bug in esp-idf 4.4 for esp32c3 -// #ifndef REG_SPI_BASE -// #define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 ))) -// // SPI_MOSI_DLEN_REG is not defined anymore in esp32c3, instead use SPI_MS_DLEN_REG +// SPI_MOSI_DLEN_REG is not defined anymore #define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x) -// #endif // REG_SPI_BASE -// #endif //ESP_IDF_VERSION_MAJOR < 5 - #endif // TARGET diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index b87a42fbf..1251235b7 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -94,13 +94,13 @@ lib_ignore = [core32] -platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.06/platform-espressif32.zip +platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.00/platform-espressif32.zip platform_packages = build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} [core32_30] -platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.12/platform-espressif32.zip +platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.10/platform-espressif32.zip platform_packages = build_unflags = ${core32.build_unflags} build_flags = ${core32.build_flags}