-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Change CPU frequency #579
Comments
CPU frequency is set automatically depending on what is chosen in Tools > CPU Frequency menu in the IDE. If you want to override this behaviour for some reasons, you may provide an alternative implementation for |
I've noticed that after using the Arduino IDE to set rate to 160 MHZ and then back to 80 MHZ, it doesn't properly return to 80 MHZ until I cycle power. Recompiling properly rebuilds with F_CPU set to 80 MHZ but preloop_update_frequency doesn't clear the clock frequency bit. Note that it's a no-op when F_CPU isn't 160 MHZ: void preloop_update_frequency() { That caused pulseIn() to return values twice as large as it should (until I power cycled). |
* 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
Add ESP library command for system_update_cpu_freq
The text was updated successfully, but these errors were encountered: