Skip to content

Commit

Permalink
Merge pull request #5921 from microDev1/espressif
Browse files Browse the repository at this point in the history
Return default cpu frequency on espressif
  • Loading branch information
tannewt authored Jan 26, 2022
2 parents 78781c6 + fa2d156 commit ac7a807
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ports/espressif/common-hal/microcontroller/Processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ac7a807

Please sign in to comment.