Skip to content

Commit 7e9dfef

Browse files
authored
Refactor getFlashClockDivider comments for clarity
1 parent de103cd commit 7e9dfef

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

cores/esp32/Esp.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -551,19 +551,13 @@ uint8_t EspClass::getFlashSourceFrequencyMHz(void) {
551551
*/
552552
uint8_t EspClass::getFlashClockDivider(void) {
553553
#if CONFIG_IDF_TARGET_ESP32
554-
// ESP32 classic: Use SPI0 structure (no 'mem_' prefix)
554+
// ESP32 classic: Use SPI0 structure
555555
if (SPI0.clock.clk_equ_sysclk) {
556556
return 1; // 1:1 clock (no divider)
557557
}
558558
return SPI0.clock.clkcnt_n + 1;
559-
#elif CONFIG_IDF_TARGET_ESP32P4 || CONFIG_IDF_TARGET_ESP32C5
560-
// ESP32-P4 and ESP32-C5: Use SPIMEM0 structure with 'mem_' prefix
561-
if (SPIMEM0.clock.mem_clk_equ_sysclk) {
562-
return 1; // 1:1 clock (no divider)
563-
}
564-
return SPIMEM0.clock.mem_clkcnt_n + 1;
565559
#else
566-
// ESP32-S2, S3, C2, C3, C6, H2: Use SPIMEM0 structure without 'mem_' prefix
560+
// All modern chips (S2, S3, C2, C3, C5, C6, H2, P4): Use SPIMEM0 structure
567561
if (SPIMEM0.clock.clk_equ_sysclk) {
568562
return 1; // 1:1 clock (no divider)
569563
}

0 commit comments

Comments
 (0)