-
-
Notifications
You must be signed in to change notification settings - Fork 86
Adding Generic Interrupt function to IRQManager #316
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
Conversation
I like it very much! Also, it looks like it can be integrated with fsp drivers structure by reusing |
I'm not sure why we need to set Also note that every function in that file should probably check if |
The reason for setting to INVALID_VECTOR and then testing for it is to guard against attaching the same interrupt twice. Most of the other implementations in IRQManager do it so I just followed the pattern. |
That doesn't really protect against installing a handler twice using a different config. A better approach would be to check if there's a handler already installed, but I understand that you're following the existing code which is fair enough. However, you should check the |
I was guessing at the purpose. For every other peripheral the code expects you to start with the irq set to that. I was just following the patters that's there for the rest of the file. I do agree that |
I added the check against I can do a separate PR to fix that for the other peripherals if that would be helpful. |
Thank you!
I think so. All the other functions should check the max index the same way too. |
I'm proposing this as an alternative to #315 that keeps the dangerous code inside the IRQManager class. This is a fix for #310
@facchinm would something like this work as an alternative?
Here's a test sketch. I know we already have attachInterrupt for pin interrupts, but I already had this set up for testing.