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 support for enabling/disabling SPI interrupts #256

Merged
merged 1 commit into from
Jul 21, 2020
Merged

Add support for enabling/disabling SPI interrupts #256

merged 1 commit into from
Jul 21, 2020

Conversation

hannobraun
Copy link
Member

No description provided.

@hannobraun
Copy link
Member Author

Rebased, no changes.

Copy link
Member

@david-sawatzke david-sawatzke left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, looks good otherwise


impl Interrupts {
pub(super) fn enable<I: Instance>(&self, spi: &I) {
spi.intenset.modify(|_, w| {
Copy link
Member

Choose a reason for hiding this comment

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

If I'm reading the documentation correctly, intenset won't clear the interrupt-enable bits, so a write is the more correct thing to do here, although modify looks like it'll work fine

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you're right. The documentation isn't super-explicit in this regard, but it makes more sense and would be in line with how these types of registers usually work.

I'll make the change (and do some experimentation to verify) before merging.

@hannobraun
Copy link
Member Author

Sorry for the delay, looks good otherwise

No problem. Thanks for the review!

@hannobraun
Copy link
Member Author

Made the suggested change. Merging.

@hannobraun hannobraun merged commit 84110f5 into lpc-rs:master Jul 21, 2020
@hannobraun hannobraun deleted the spi-interrupts branch July 21, 2020 10:47
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