mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
Use F_CPU if (?) CPU frequency switch is compile-time only (#6833)
* At least the F_CPU define in host mock.h is needed by host Arduino.h - need to include Arduino.h further down in mock.h for this to work. * Geting the include order right * Prepare for runtime CPU clock rate selection * Fix compile for not defined F_CPU If defined F_CPU, make getCpuFreqMHz() a constexpr * Use defines for register CPU2X instead of hex value * Fix build for host - getCpuFreqMHz there was also in conflict with getCycleCount, using F_CPU: tests/host/common/mock.h:#define F_CPU 80000000 (!) * Asymmetrical includes and defines on host * Support restart switch from 160MHz to 80MHz, e.g for OTA. Fixes #579
This commit is contained in:
@ -118,11 +118,6 @@ uint32_t EspClass::getFreeSketchSpace()
|
||||
return 4 * 1024 * 1024;
|
||||
}
|
||||
|
||||
uint8_t EspClass::getCpuFreqMHz()
|
||||
{
|
||||
return F_CPU / 1000000;
|
||||
}
|
||||
|
||||
const char *EspClass::getSdkVersion()
|
||||
{
|
||||
return "2.5.0";
|
||||
|
Reference in New Issue
Block a user