Merge pull request #5921 from microDev1/espressif

Return default cpu frequency on espressif
This commit is contained in:
Scott Shawcroft 2022-01-26 10:26:45 -08:00 committed by GitHub
commit ac7a80753f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -60,7 +60,13 @@ float common_hal_mcu_processor_get_voltage(void) {
}
uint32_t common_hal_mcu_processor_get_frequency(void) {
return 0;
#ifdef CONFIG_IDF_TARGET_ESP32C3
return CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ * 1000000;
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
return CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ * 1000000;
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
return CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ * 1000000;
#endif
}
STATIC uint8_t swap_nibbles(uint8_t v) {