-
Notifications
You must be signed in to change notification settings - Fork 238
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 documentation for esp-hal-embassy
on underlying embassy-time-driver
's tick-hz
#2985
Comments
Doesn't esp-hal count as the end user in this case? 🤔 |
Whilst true for most libraries, this library also contains the time driver that is configured to fire at 1000hz, which is why we set it so. Setting anything other than this, and using the same driver is wrong. So why do you want to change the time driver's hz? |
We also don't support configuring generic timer queue capacities using their respective embassy-time features. This is at least party intentional, as we have a configuration system in place that is a bit more flexible than a list of cargo features. We technically could make the tick rate configurable, but that would mean potentially changing the resolution of unrelated timers as well.
You could argue that way as well :) There are chips that only support a single frequency, and you can't configure those as well. The existence of these features don't imply they are useful as well for every system. |
Thanks for the inputs!
We can say so - or if the project structure allows, we can have a set of predefined usable frequencies with compile-time checking.
Just to confirm, is it 1MHz or 1kHz? Because the current value is 1MHz (1_000_000), and seems oddly high for an interrupt timer and not a timer for time-keeping.
Makes sense. And I do understand that it will be a PITA for the hal to change the base timer. I forgot to mention my use case - I was looking for a way to get a 100ns resolution time counter in embassy for precise time measurements. (meaning 10MHz in embassy-time) I guess I should change the title to somewhere in the lines of "add notes on embassy-time's tick rate when used with esp-hal-embassy" ? |
|
The timer interrupts are not periodic. The underlying timers are ticking at 1MHz, the time driver is firing interrupts as timers expire, and only when timers expire. |
Thanks, I'll update the title then! Looks like I've got a lot to learn! Sincere thanks to all of you who made this literally awesome development experience possible! |
esp-hal-embassy
shouldn't hard-code embassy-time-driver
's tick-hzesp-hal-embassy
on underlying embassy-time-driver
's tick-hz
Bug description
When using
esp-hal-embassy
, one cannot setembassy-time
's tick rate.This is due to esp-hal-embassy hardcoding the value, which embassy-time says not to do in libraries.
To Reproduce
minimal repro: TBD
Expected behavior
We should be able to (within a reasonable extent) change the underlying tick rate.
Environment
Notes
I haven't deciphered the hal codebase yet (I'm a newcomer to rust overall), so I don't know if this is due to a hardware limitation, or just simple oversight.
The text was updated successfully, but these errors were encountered: