-
Notifications
You must be signed in to change notification settings - Fork 513
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
Low latency (direct) interrupt handlers #1394
Conversation
…2F2xx platform headers
…rrupts_hal.h without platform dependency (is there a better way?)
…errupt handler overrides
…rupt handler overrides
…attachInterruptDirect()/detachInterruptDirect() [branch ch7827]
Reminder to review! |
Are you psychic...I was literally reviewing this when you commented! |
I'll try and test with SparkIntervalTimer and a scope. This is an important one to release as soon as its ready IMO. |
I tried this feature branch with my SparkIntervalTimer library coupled with my RGBPongClock and I get a hard fault. I will test with a more basic app (blink LED) along with the SparkIntervalTimer library next. |
I tried a simple app with SparkIntervalTimer (using attachInterruptDirect()) and I get hard fault immediately after flashing over the code. If I compile with regular To test, I simply change the original code using |
@pkourany I've just built SparkIntervalTimer with minimal changes: if (!attachInterruptDirect(TIM3_IRQn, Wiring_TIM3_Interrupt_Handler_override)) ; //error
if (!attachInterruptDirect(TIM4_IRQn, Wiring_TIM4_Interrupt_Handler_override)) ; //error
if (!attachInterruptDirect(TIM5_IRQn, Wiring_TIM5_Interrupt_Handler_override)) ; //error
if (!attachInterruptDirect(TIM6_DAC_IRQn, Wiring_TIM6_Interrupt_Handler_override)); //error
if (!attachInterruptDirect(TIM7_IRQn, Wiring_TIM7_Interrupt_Handler_override)); //error and used the example provided with it, and it does not crash. Don't have a scope at hand, but at the very least D7 is flashing as intended. EDIT: |
@avtolstoy, as I read your post I realized that with all my testing, I failed to update the system firmware parts! I'll test again just to confirm. Thanks! |
@avtolstoy, I must be missing something. I checked out the branch, go to the firmware/modules directory and build/flash the system firmware and app using: make clean all PLATFORM=photon APP=rgbpcFastInt program-dfu Everything compiles and flashes but same hard fault. What am I missing? |
Tested with SparkIntervalTimer (with some overdue mods) and it works. Good to go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested successfully with SparkIntervalTimer library.
Paul, what was the cause of the hard fault? Anything we need to look into? |
Who's going to write up the docs for this? We need to make clear the interplay between the normal wiring interrupts and the direct interrupts, and provide guidance on when to use which. |
Will there be a version of |
submission notes
Problem
See #1168 #1333
Solution
This PR adds two wiring functions
attachInterruptDirect()
anddetachInterruptDirect()
that allow the user code to directly insert interrupt handlers into the interrupt vector table.Steps to Test
wiring/no_fixture
:INTERRUPTS_04_attachInterruptDirect
Example App
References
Completeness