Skip to content
Prev Previous commit
Next Next commit
According to leading core developer, runtime CPU frequency switch is …
…unsupported, anyway.
  • Loading branch information
dok-net committed Apr 11, 2020
commit 26f6ac8c4b607c0c86a65bca5e5c8e1932e515c5
5 changes: 0 additions & 5 deletions cores/esp8266/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,6 @@ uint8_t EspClass::getBootMode(void)
return system_get_boot_mode();
}

uint8_t EspClass::getCpuFreqMHz(void)
{
return system_get_cpu_freq();
}


uint32_t EspClass::getFlashChipId(void)
{
Expand Down
11 changes: 11 additions & 0 deletions cores/esp8266/Esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ class EspClass {
uint8_t getBootVersion();
uint8_t getBootMode();

#ifndef CORE_MOCK
inline uint8_t getCpuFreqMHz() __attribute__((always_inline));
#else
uint8_t getCpuFreqMHz();
#endif


uint32_t getFlashChipId();
uint8_t getFlashChipVendorId();
Expand Down Expand Up @@ -201,6 +206,12 @@ class EspClass {
};

#ifndef CORE_MOCK

uint8_t EspClass::getCpuFreqMHz()
{
return clockCyclesPerMicrosecond();
}

uint32_t EspClass::getCycleCount()
{
return esp_get_cycle_count();
Expand Down