Skip to content

Commit fa2d156

Browse files
committed
return default cpu frequency on espressif
1 parent 3904421 commit fa2d156

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ports/espressif/common-hal/microcontroller/Processor.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ float common_hal_mcu_processor_get_voltage(void) {
6060
}
6161

6262
uint32_t common_hal_mcu_processor_get_frequency(void) {
63-
return 0;
63+
#ifdef CONFIG_IDF_TARGET_ESP32C3
64+
return CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ * 1000000;
65+
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
66+
return CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ * 1000000;
67+
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
68+
return CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ * 1000000;
69+
#endif
6470
}
6571

6672
STATIC uint8_t swap_nibbles(uint8_t v) {

0 commit comments

Comments
 (0)