Skip to content

Commit 843a69a

Browse files
authored
fix(esp): Fix getFlashChipMode breaking on S3 and C3
1 parent 12d4226 commit 843a69a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cores/esp32/Esp.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ extern "C" {
5959
// REG_SPI_BASE is not defined for S3/C3 ??
6060

6161
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3
62-
#ifndef REG_SPI_BASE
63-
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 )))
64-
#endif // REG_SPI_BASE
65-
#endif // TARGET
62+
#ifdef REG_SPI_BASE
63+
#undef REG_SPI_BASE
64+
#endif // REG_SPI_BASE
65+
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i) * 0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000)))
66+
#endif // TARGET
6667

6768
/**
6869
* User-defined Literals

0 commit comments

Comments
 (0)