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
Pin interrupt dispatching is not thread/interrupt safe #181
Comments
In theory, you are right. But the chances that somebody calls detachInterrupt inside an interrupt On the other hand, if you have better code that is not slower , |
There are some uses cases. This is an issue that would be almost impossible to track down, since would occur extremely rarely. The Teensy would just hang every few weeks or months. |
Fix issue #181. Improved pin interrupt dispatch performance.
This was fixed by #181, right? |
Fixed by #182. |
The port interrupt pin dispatch code
if ((isfr & CORE_PIN1_BITMASK) && intFunc[1]) intFunc[1]();
compiles down to the following:
ldr r2, [r3, #4]
is a load from the intFunc[] table, loading the pin interrupt address. A NULL check is done, then the intFunc[] table load is performed again and the pointer from the table is called.A higher priority ISR could be called between the two loads from intFunc[]. If that ISR uses detachInterrupt for the pin, NULL will be called.
The text was updated successfully, but these errors were encountered: