-
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
Use F_CPU if (?) CPU frequency switch is compile-time only #6833
Conversation
That would be nice. |
@TD-er That left to future considerations, do you have any issues with the merit of this PR alone? It's about constexpr (latest addition) for getCpuFreqMHz(). |
Nope, PR looks good. |
c95df91
to
0336df4
Compare
a0060a2
to
165e094
Compare
165e094
to
5214d3f
Compare
Based on what cnlohr got when he changed the baseband PLL, the rfpll is tied to bbpll somehow and the WiFi spectrum narrowed when he slowed the CPU down. You might be able to dynamically switch, but you'd need to reprogram the WiFi as well. edit: Nope, I'm wrong. The center frequency of Charles' tests stayed the same as did the RF envelope, so the only thing that changed was the data rate (slower CPU clock = slower data rate = narrower spectrum). Looks like you might be able to dynamically switch the CPU without regard to the WiFi programming, but SYS would need to know the CPU changed to adjust various timings. |
5214d3f
to
941a9df
Compare
d9f25e9
to
f407591
Compare
4485919
to
66b43a0
Compare
…- need to include Arduino.h further down in mock.h for this to work.
…unsupported, anyway.
If defined F_CPU, make getCpuFreqMHz() a constexpr
Prepare PolledTimeout for dynamic CPU frequency - would fail to compile if F_CPU is not defined, helps as marker that something needs to be done.
…tCycleCount, using F_CPU: tests/host/common/mock.h:#define F_CPU 80000000 (!)
Then ESP.getCpuFreqMHz() can be optimized to use F_CPU and be constexpr.
polledTimeout using F_CPU instead of the dynamic
system_get_cpu_freq()
anyway, I see no issue.On review, please consider this, in
core_esp8266_main.cpp
:Could this be turned into dynamic frequency switching?