Skip to content

Commit 089f808

Browse files
authored
fix compile for esp32
1 parent a74b0f1 commit 089f808

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cores/esp32/chip-debug-report.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,17 @@ void printAfterSetupInfo(void) {
374374
* @return Source clock frequency in MHz (80, 120, 160, or 240)
375375
*/
376376
uint8_t getFlashSourceFrequencyMHz(void) {
377+
#if CONFIG_IDF_TARGET_ESP32
378+
// ESP32 classic supports 40 MHz and 80 MHz
379+
// Note: ESP32 uses the PLL clock (80 MHz) as source and divides it
380+
return 80; // Always 80 MHz source, divider determines 40/80 MHz
381+
#else
377382
volatile uint32_t* core_clk_reg = (volatile uint32_t*)(FLASH_SPI0_BASE + FLASH_CORE_CLK_SEL_OFFSET);
378383
uint32_t core_clk_sel = (*core_clk_reg) & 0x3; // Bits 0-1
379384

380385
uint8_t source_freq = 80; // Default
381386

382-
#if CONFIG_IDF_TARGET_ESP32
383-
// ESP32 classic supports 40 MHz and 80 MHz
384-
// Note: ESP32 uses the PLL clock (80 MHz) as source and divides it
385-
source_freq = 80; // Always 80 MHz source, divider determines 40/80 MHz
386-
#elif CONFIG_IDF_TARGET_ESP32S3
387+
#if CONFIG_IDF_TARGET_ESP32S3
387388
switch (core_clk_sel) {
388389
case 0: source_freq = 80; break;
389390
case 1: source_freq = 120; break;
@@ -405,6 +406,7 @@ uint8_t getFlashSourceFrequencyMHz(void) {
405406
#endif
406407

407408
return source_freq;
409+
#endif
408410
}
409411

410412
/**

0 commit comments

Comments
 (0)