From 0f53ae845aa52725da0c6832f132bae39917484c Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 22 Aug 2022 16:14:20 +0200 Subject: [PATCH] Real fix, S2 shows now correct mode too --- tasmota/tasmota_support/support_esp.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_support/support_esp.ino b/tasmota/tasmota_support/support_esp.ino index 270260b1b..16662dc3d 100644 --- a/tasmota/tasmota_support/support_esp.ino +++ b/tasmota/tasmota_support/support_esp.ino @@ -983,10 +983,14 @@ typedef enum { } FlashMode_t; */ String ESP_getFlashChipMode(void) { -#if ESP8266 || CONFIG_IDF_TARGET_ESP32S2 +#if ESP8266 uint32_t flash_mode = ESP.getFlashChipMode(); #else - uint32_t spi_ctrl = REG_READ(SPI_CTRL_REG(0)); + #if CONFIG_IDF_TARGET_ESP32S2 + const uint32_t spi_ctrl = REG_READ(PERIPHS_SPI_FLASH_CTRL); + #else + const uint32_t spi_ctrl = REG_READ(SPI_CTRL_REG(0)); + #endif uint32_t flash_mode; /* Not all of the following constants are already defined in older versions of spi_reg.h, so do it manually for now*/ if (spi_ctrl & BIT(24)) { //SPI_FREAD_QIO