-
Notifications
You must be signed in to change notification settings - Fork 221
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
Extract embassy support into esp-hal-embassy
and esp-hal-embassy-procmacros
packages
#976
Conversation
mod time_driver; | ||
|
||
/// TODO: document me | ||
#[cfg(any(feature = "time-systimer", feature = "time-timg0"))] |
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.
Is there a valid configuration where neither of these are active?
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.
Nope, just forgot to add the build script to verify the features, and that was temporarily added to silence some warnings. Thanks for the reminder, will get that fixed tomorrow.
Oh no ... took me a year to learn it's not |
So what's the current state wrt. systimer, the async drivers and interrupt handlers? Is it possible the users end up with a duplicate interrupt handler error? Can we even avoid that with the crate split? For me it's a bit weird that as a user, I'll have to import embassy-executor for two types and a macro, as well as esp-hal-embassy for the chip support and esp-hal as well. It wasn't super clear what features needed to be set where and I think this change makes it worse. We either need to somehow provide everything (Spawners and the task macro) without the embassy-executor dependency (which is not super annoying IMO because of the arena size configuration), or we have to make this absolutely super clear in documentation which people won't read anyway if they use esp-template 🤦♂️ |
interrupt, | ||
peripherals::{self, SYSTEM}, | ||
}; | ||
|
||
/// global atomic used to keep track of whether there is work to do since sev() | ||
/// is not available on either Xtensa or RISC-V | ||
#[cfg(not(multi_core))] | ||
#[cfg(not(any(feature = "esp32", feature = "esp32s3")))] |
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.
Completely off-topic but maybe we need a esp-metadata
crate which contains the tomls etc from the soc module. This would allow crates other than esp-hal to use these nice cfgs!
Hmm this didn't turn out quite like I had in my head, I'm not sure depending on two crates is better than one. I guess there is no way for esp-hal-embassy to not depend on esp-hal-common? I like the separation, but not at the cost of a user having to depend on two things. I'll think a little bit more about this. |
Would you mind elaborating on this a bit? I'm really not sure how else this would look (maybe I'm just missing something obvious, though). |
Sorry, that was me just rambling, my main point was that I hadn't anticipated the cyclic dependency, I was hoping we would have been able to reexport one of the crates from the other but that won't be possible. I really like the separated dependencies/features etc, I just wonder if we're pushing the maintenance burden to end user cognitive burden by having them have to be aware and depend on two different crates. |
We could re-export those from esp-hal-embassy since it already depends on embassy-executor? |
Sorry, forgot to reply to this. I think this is an unsolved problem still, I don't have a solution yet. I have
As suggested by @bjoernQ perhaps we could re-export the relevant |
I'm not sure how much of a problem this really will be in practice. The HAL will be required regardless, and then if people want to use Embassy alongside it they would ideally just require one additional package, |
My main worry is |
a45f4e0
to
f582368
Compare
I still need to add the build script and do some assorted cleanup, but I've rebased this branch at least. Will do the rest next week. |
Opening this as a draft as I still need to do some more review, probably more cleanup, and some more testing. However, I'd like to get some eyes on it as it should be close to ready.
This PR decouples Embassy support from the
esp-hal-common
package. I've additionally created an additional procmacro package,esp-hal-embassy-procmacros
, for Embassy-specific needs.Some notable changes:
embassy-
prefix removed, as it's now redundanttime-systick
totime-systimer
to better reflect which peripheral is being usedI will add review comments for anything else that may need attention, as I identify these parts.
CC @MabezDev @bjoernQ @bugadani