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

Unclear how to use #[interrupt] macro without deprecated --reexport-interrupt flag #830

Open
qwandor opened this issue Mar 26, 2024 · 3 comments

Comments

@qwandor
Copy link

qwandor commented Mar 26, 2024

According to the documentation of svd2rust, the --reexport-interrupt flag is deprecated. However according to the documentation of cortex-m-rt, the #[interrupt] macro should only be used via the svd2rust reexport, and indeed it fails to compile when used directly, with a confusing error.

How is the interrupt macro supposed to be used without the --reexport-interrupt flag passed to svd2rust? This should at least be documented clearly in the svd2rust documentation.

@burrbull
Copy link
Member

burrbull commented Mar 26, 2024

There have been planned some changes in cortex-m-rt 0.8 like moving interrupt in independent crate. But it is not done yet.
Ask @adamgreig.

@robamu
Copy link
Contributor

robamu commented Jun 25, 2024

I also stumbled into the issue, wondering why I could not use the interrupt macro, and I had to rebuild with the --reexport-interrupt flag.

@royb3
Copy link

royb3 commented Aug 14, 2024

You can use it without the flag. But you have to import your PAC's Interrupt enum as interrupt.

use hal::pac::Interrupt as interrupt;
use cortex_m_rt::interrupt;

That's basically what the --reexport-interrupt flag does as well. Not sure if there's any value in doing this over using the deprecated flag for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants