-
Notifications
You must be signed in to change notification settings - Fork 246
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
Add xtal frequency configuration #3054
base: main
Are you sure you want to change the base?
Conversation
05d97f9
to
f9ba7a0
Compare
( | ||
"xtal-frequency", | ||
"The frequency of the crystal oscillator, in MHz. Set to `auto` to automatically detect the frequency. `auto` may not be able to identify the clock frequency in some cases. Also, configuring a specific frequency may increase performance slightly.", | ||
Value::String(match device_name { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to run into issues if someone wants to set this config but also support multiple different chips in the same project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We won't, but they will
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess #3020 will support this scenario better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR adds
ESP_HAL_CONFIG_XTAL_FREQUENCY
- although only 32 and C2 have meaningful configurability. THe point of this PR is to allow const-propagatingxtal_freq
wherever possible, mostly affectingesp_hal::time::now()
and indirectly embassy-time.We could probably double-check in
Clocks::init
that the configured frequency matches what we measure, I don't know how badly we would want that, though.Running a modified
embassy_executor_benchmark
on the S2 (no time queue tasks, Task1 reading current time in every loop):now()
black_box(now())