Closed udellc closed 3 years ago
I found the issue. Loom_Interrupt_Manager::register_ISR assigns the interrupt settings to the int_settings
array using the pin number as an index, which has 16 spots available for pin interrupts. Unfortunately, the analog pins A2-A7 refer to values between 16-45, causing a segfault when a pin value >15 is used as an index access the int_settings
array. I need to do more research on how to fix this issue, but in the meantime ISRs on pins > A1 should be considered broken.
I created a pull request to warn the user if their interrupt pin is out of bounds while we figure out how to solve this more permanently: https://github.com/OPEnSLab-OSU/Loom/pull/77.
This issue has been solved in version 2.5.0 which can be read about here. There are still limitations to the combinations of pins that interrupts can be attached to, but these are systemic to vanilla interrupts. There is also a sketch that demonstrates how to use interrupts now.
Describe the bug Vanilla Attach interrupt works, but not Loom for Analog pins
Talk with Liam