Skip to content

re-export the interrupt attribute #235

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

Merged
merged 5 commits into from
Nov 14, 2018
Merged

re-export the interrupt attribute #235

merged 5 commits into from
Nov 14, 2018

Conversation

japaric
Copy link
Member

@japaric japaric commented Sep 17, 2018

this is a breaking change because

  • it bumps the cortex-m-rt version requirement to v0.6.4

  • it changes the behavior of the <device>::interrupt item. This item was a
    bang macro and now has become an attribute.

@therealprof
Copy link
Contributor

LGTM

@japaric
Copy link
Member Author

japaric commented Sep 17, 2018

Before landing this, the RFC rust-embedded/cortex-m-rt#122 needs to be accepted.

@thejpster
Copy link
Contributor

Pinging @whitequark as we'll want to re-spin tm4c12xx when this lands.

bors bot added a commit to rust-embedded/cortex-m-rt that referenced this pull request Oct 9, 2018
122: [RFC] `#[interrupt]` r=therealprof a=japaric

this PR adds an `interrupt` attribute that's similar to the existing `exception`
except that it's used to override device-specific interrupt handlers.

The other big difference is that `cortex_m_rt::interrupt` can't be directly
used; it must first be imported from a device crate, which re-exports
`cortex_m_rt::interrupt`. This is required to check at compile time that the
interrupt is valid for the target device.

Safe `static mut` variables can be used with `#[interrupt]` handlers. The syntax
is the same as `#[exception]`s.

More background information can be found in #109.

The companion svd2rust PR is rust-embedded/svd2rust#235

r? @rust-embedded/cortex-m

Co-authored-by: Jorge Aparicio <[email protected]>
Co-authored-by: Adam Greig <[email protected]>
@adamgreig
Copy link
Member

Upstream cortex-m-rt v0.6.5 has landed with #[interrupt] now, so this is unblocked (but the dependency will need bumping to 0.6.5).

benkard added a commit to benkard/stm32f4xx-hal that referenced this pull request Nov 7, 2018
this is a breaking change because

- it bumps the cortex-m-rt version requirement to v0.6.4

- it changes the behavior of the `<device>::interrupt` item. This item was a
bang macro and now have become an attribute.
@japaric
Copy link
Member Author

japaric commented Nov 11, 2018

Triage: this has been accepted by the cortex-m team and it's waiting for review.

@japaric japaric added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. decision-accepted and removed needs-decision labels Nov 11, 2018
@japaric japaric added this to the v0.14.0 milestone Nov 11, 2018
@japaric japaric requested a review from a team November 11, 2018 17:53
therealprof
therealprof previously approved these changes Nov 11, 2018
Copy link
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@japaric
Copy link
Member Author

japaric commented Nov 14, 2018

bors r=therealprof

bors bot added a commit that referenced this pull request Nov 14, 2018
235: re-export the `interrupt` attribute r=therealprof a=japaric

this is a breaking change because

- it bumps the cortex-m-rt version requirement to v0.6.4

- it changes the behavior of the `<device>::interrupt` item. This item was a
bang macro and now has become an attribute.

Co-authored-by: Jorge Aparicio <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 14, 2018

Build failed

@japaric
Copy link
Member Author

japaric commented Nov 14, 2018

fixed the build error. re-r? @therealprof (or anyone else)

@therealprof
Copy link
Contributor

bors r+

bors bot added a commit that referenced this pull request Nov 14, 2018
235: re-export the `interrupt` attribute r=therealprof a=japaric

this is a breaking change because

- it bumps the cortex-m-rt version requirement to v0.6.4

- it changes the behavior of the `<device>::interrupt` item. This item was a
bang macro and now has become an attribute.

Co-authored-by: Jorge Aparicio <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 14, 2018

Build succeeded

@bors bors bot merged commit 347abeb into master Nov 14, 2018
@bors bors bot deleted the interrupt-attr branch November 14, 2018 23:40
adamgreig added a commit to rust-embedded/cortex-m that referenced this pull request Jan 12, 2022
122: [RFC] `#[interrupt]` r=therealprof a=japaric

this PR adds an `interrupt` attribute that's similar to the existing `exception`
except that it's used to override device-specific interrupt handlers.

The other big difference is that `cortex_m_rt::interrupt` can't be directly
used; it must first be imported from a device crate, which re-exports
`cortex_m_rt::interrupt`. This is required to check at compile time that the
interrupt is valid for the target device.

Safe `static mut` variables can be used with `#[interrupt]` handlers. The syntax
is the same as `#[exception]`s.

More background information can be found in #109.

The companion svd2rust PR is rust-embedded/svd2rust#235

r? @rust-embedded/cortex-m

Co-authored-by: Jorge Aparicio <[email protected]>
Co-authored-by: Adam Greig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change decision-accepted S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants