Skip to content
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

SW3 isn't correctly cfg'd away when it's used by embassy multicore executor #1987

Closed
MabezDev opened this issue Aug 23, 2024 · 4 comments · Fixed by #2011
Closed

SW3 isn't correctly cfg'd away when it's used by embassy multicore executor #1987

MabezDev opened this issue Aug 23, 2024 · 4 comments · Fixed by #2011
Labels
bug Something isn't working

Comments

@MabezDev
Copy link
Member

#[cfg(not(all(feature = "embassy", multi_core)))]
pub software_interrupt3: SoftwareInterrupt<3>,

The embassy feature no longer exists on esp-hal, therfore this cfg doesn't work correctly.

@MabezDev MabezDev added bug Something isn't working async labels Aug 23, 2024
@Dominaezzz
Copy link
Collaborator

Ideally this should be solved with the type system rather than a cargo feature.
Something along the lines of esp_hal_embassy::init(&clocks, timer, software_interrupt3, .....).

One shouldn't need special code in the hal to add support for an async runtime.

@bugadani
Copy link
Contributor

While I agree with the idea of a type-system solution, I'm not entirely happy about the boilerplate necessary for this and I'd prefer re-introducing the feature instead. We can hide it from the users (depending on esp-hal-embassy could automatically enable the feature), and third party runtimes can do whatever they wish.

@Dominaezzz
Copy link
Collaborator

and third party runtimes can do whatever they wish.

What happens when you have multiple async runtimes then? How do you ensure they're not going to fight over the 4th software interrupt?

Side note: There should probably be an AnySoftwareInterrupt type or something.

I agree that the boilerplate isn't fantastic but it's the only way to know what parts of your software is using what piece of hardware. Coming from C/C++ embedded space, I'd be very happy to not have the issue where two different libraries are fighting over the same peripheral. Even esp-idf's libraries have this problem.
I think not having this problem is more valuable than saving some boilerplate.

This particular bit of boilerplate can be fixed with a macro I think.

@bugadani
Copy link
Contributor

I believe it is worth optimising for the common use case. Third party runtimes can deal with pass-interrupt-by-value if they need to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants