-
Notifications
You must be signed in to change notification settings - Fork 201
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
RTIC v2.0.0 support #765
Comments
Hi @kyp44 and welcome! Ideally the implementation would live in this crate. By all means, feel free to open up a PR with a RTIC v2 monotonic implementation. I've actually been meaning to do it too, just haven't found the time yet - I'd be happy to assist you with that. By the way, if you're looking for async support on more peripherals: I've been working on adding async APIs to the HAL. The PR is pretty much complete at this point, it just hasn't gotten merged yet. Having some extra hands testing it out would absolutely help with getting it over the finish line. |
@jbeaurivage I appreciate the response! While I have never used RTIC v1, my impression is that the I do need async delays for my application, but looking at the async methods you've implemented for So I think I still would like to try to implement the global I'll fork and start working on this right away, and I'm happy to have you help or at least have another set of eyes on my implementation. I'm also happy to help you test your async HAL extensions, though I only have a PyGamer in terms of ATSAMD hardware so I may be limited in what I can test. |
No problem! Yeah having a global monotonic is entirely optional on v2. |
@kyp44 By the way, do reach out on Matrix if you haven't already: https://matrix.to/#/#atsamd-rs:matrix.org |
Most |
Status update: here I have got an RTC-based monotonic pretty much fully working, but am still working on ironing out some async behaviors that may or may not even be the monotonic misbehaving. Currently, the monotonic is implemented directly in the HAL but @jbeaurivage and I have been discussing on Matrix, and it may be more appropriate to submit it to the |
Hi, I'm new here. I'm working on a game targeting the PyGamer, which has a nice BSP here. Being a game, using async Rust is extremely valuable for me, and information on using async on SAMD processors seems to be very scare. It doesn't seem like Embassy supports SAMD processors at all, but RTIC v2 now uses async for software tasks, whereas v1 did not.
The HAL crate here does support RTIC (via the
rtic
feature), but it only seems to support RTIC v1 by implementing the oldMonotonic
trait. Things have changed with v2 and now there is a differentMonotonic
trait that has to be implemented, which involves some async functions.The current paradigm for RTIC v2 is to select the time driver from the
rtic_monotonics
crate, in which the type that implementsMonotonic
is created using macros instead of passing it to theapp
RTIC macro as before. Looking at the code for the supported microcontrollers (noting that SAMD is not among them), it seems likeMonotonic
is most easily implemented indirectly by instead implementing the simplerTimerQueueBackend
trait, which does not involve any async methods.I think I have enough embedded experience to implement an RTC-based driver for RTIC v2. Given that the v1 driver was implemented in this HAL instead of within the RTIC project, I wanted to solicit opinions on whether a new v2 driver should also just live with the HAL here (including relevant macros), or by adding SAMD support to the RTIC project? Thoughts?
NOTE: I am aware that I can already use RTIC v2 on SAMD chips using the
SysTick
driver that ships with RTIC, but I want a more efficient driver that does not generate frequent, periodic interrupts.The text was updated successfully, but these errors were encountered: