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

Add STIR register to NVIC peripheral #91

Closed
wants to merge 1 commit into from
Closed

Add STIR register to NVIC peripheral #91

wants to merge 1 commit into from

Conversation

thenewwazoo
Copy link

Quick and dirty PR to add software interrupt request capability

Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @thenewwazoo.

I left comments about few things that need / should be changed.

Could you also add a test in peripheral/test.rs that checks that STIR has address 0xE000EF00?

reserved5: [u32; 696],

/// Software Trigger Interrupt
pub stir: WO<u32>,
Copy link
Member

Choose a reason for hiding this comment

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

STIR is not present on ARMv6-M so this needs #[cfg(not(armv6m))].

}

impl NVIC {
/// Request an IRQ in software
pub fn req_irq<I>(&mut self, interrupt: I)
Copy link
Member

Choose a reason for hiding this comment

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

I think this method should be renamed to request. The other NVIC methods like enabled(interrupt: I) are read as "enable interrupt", so I think "request interrupt" would be more fitting.

I think this method should include a comment similar to what's included in the ARM documentation:

Writing a value to the INTID field is the same as manually pending an interrupt by setting the corresponding interrupt bit in an Interrupt Set Pending Register.

Copy link
Member

Choose a reason for hiding this comment

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

I think this method should include a comment similar to what's included in the ARM documentation:

in particular the comment should mention that this method is similar to set_pending.

@japaric
Copy link
Member

japaric commented Aug 3, 2018

Thank you for this PR @thenewwazoo ! Unfortunately we haven't heard from you on this in a while, so I'm closing the PR to keep things tidy. Don't worry though, if you'll have time again in the future please reopen this PR, we'll be happy to review it again!

@japaric japaric closed this Aug 3, 2018
adamgreig pushed a commit that referenced this pull request Jan 12, 2022
95: [RFC] remove build dependency on arm-none-eabi-gcc (binary blob alternative) r=japaric a=japaric

Before this commit we used gcc to assemble external assembly files into object
files that we linked into our Rust program.

This commit drops the dependency on gcc by shipping the already assembled object
files with this crate source code.

---

This is an alternative to RFC #91 that doesn't require a breaking change or
adding a new Cargo feature and can be implemented right now.

See #91 for the rationale of dropping the dependency on gcc.

This approach can be applied to other Cortex-M crates like cortex-m-semihosting
and cortex-m (would subsume RFC #107).

This seems like an overall better approach to me, but before I go opening more
PRs I want to hear your thoughts, @rust-embedded/cortex-m

closes #91

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
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

Successfully merging this pull request may close these issues.

2 participants