Skip to content

Commit 5d22dfc

Browse files
committed
c5 fix
1 parent 934cafd commit 5d22dfc

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
@@ -560,17 +560,11 @@ uint8_t EspClass::getFlashClockDivider(void) {
560560
return 1; // 1:1 clock (no divider)
561561
}
562562
return SPI1.clock.clkcnt_n + 1;
563-
#elif CONFIG_IDF_TARGET_ESP32C5
564-
// ESP32-C5: Flash uses SPIMEM1 with mem_ prefixed fields
565-
// See: esp-idf/components/hal/esp32c5/include/hal/spimem_flash_ll.h line 42
566-
if (SPIMEM1.clock.mem_clk_equ_sysclk) {
567-
return 1; // 1:1 clock (no divider)
568-
}
569-
return SPIMEM1.clock.mem_clkcnt_n + 1;
570563
#else
571-
// (S2, S3, C2, C3, C6, C61, H2, P4): Flash uses SPIMEM1
564+
// All modern chips (S2, S3, C2, C3, C5, C6, C61, H2, P4): Flash uses SPIMEM1
572565
// See: esp-idf/components/hal/esp32*/include/hal/spimem_flash_ll.h
573566
// Example S3: line 38: typedef typeof(SPIMEM1.clock.val) spimem_flash_ll_clock_reg_t;
567+
// Example C5: esp-idf/components/soc/esp32c5/mp/include/soc/spi_mem_struct.h lines 97-99
574568
if (SPIMEM1.clock.clk_equ_sysclk) {
575569
return 1; // 1:1 clock (no divider)
576570
}

0 commit comments

Comments
 (0)