Skip to content

Commit a74b0f1

Browse files
authored
Refactor source frequency logic for ESP32
Updated source frequency handling for ESP32 and ESP32S3 targets.
1 parent 54ca41e commit a74b0f1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cores/esp32/chip-debug-report.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,11 @@ uint8_t getFlashSourceFrequencyMHz(void) {
379379

380380
uint8_t source_freq = 80; // Default
381381

382-
#if CONFIG_IDF_TARGET_ESP32S3
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
383387
switch (core_clk_sel) {
384388
case 0: source_freq = 80; break;
385389
case 1: source_freq = 120; break;
@@ -398,9 +402,6 @@ uint8_t getFlashSourceFrequencyMHz(void) {
398402
case 0: source_freq = 80; break;
399403
case 1: source_freq = 120; break;
400404
}
401-
#elif CONFIG_IDF_TARGET_ESP32
402-
// ESP32 classic - simplified
403-
source_freq = 80;
404405
#endif
405406

406407
return source_freq;

0 commit comments

Comments
 (0)