Skip to content

Commit ffeebf8

Browse files
authoredJun 3, 2024
fix(esp): Fix getFlashChipMode breaking on S3 and C3 (espressif#9758)
1 parent e33022f commit ffeebf8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

‎cores/esp32/Esp.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ extern "C" {
7171
// REG_SPI_BASE is not defined for S3/C3 ??
7272

7373
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3
74-
#ifndef REG_SPI_BASE
75-
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i) * 0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000)))
74+
#ifdef REG_SPI_BASE
75+
#undef REG_SPI_BASE
7676
#endif // REG_SPI_BASE
77+
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i) * 0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000)))
7778
#endif // TARGET
7879

7980
/**

‎cores/esp32/chip-debug-report.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ static void printFlashInfo(void) {
113113
#endif
114114
// REG_SPI_BASE is not defined for S3/C3 ??
115115
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3
116-
#ifndef REG_SPI_BASE
117-
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i) * 0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000)))
116+
#ifdef REG_SPI_BASE
117+
#undef REG_SPI_BASE
118118
#endif // REG_SPI_BASE
119+
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i) * 0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000)))
119120
#endif // TARGET
120121

121122
chip_report_printf("Flash Info:\n");

0 commit comments

Comments
 (0)