8000 Use F_CPU if (?) CPU frequency switch is compile-time only by dok-net · Pull Request #6833 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Use F_CPU if (?) CPU frequency switch is compile-time only #6833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 15, 2020
Merged
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
0