1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-23 08:45:22 +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:
Dirk O. Kaar
2020-04-15 22:15:35 +02:00
committed by GitHub
parent e5f4514847
commit 6cb16997d8
5 changed files with 25 additions and 10 deletions

View File

@ -264,11 +264,12 @@ uint8_t EspClass::getBootMode(void)
return system_get_boot_mode();
}
#ifndef F_CPU
uint8_t EspClass::getCpuFreqMHz(void)
{
return system_get_cpu_freq();
}
#endif
uint32_t EspClass::getFlashChipId(void)
{