tinchox3524 / arduino-pinchangeint

Automatically exported from code.google.com/p/arduino-pinchangeint
0 stars 0 forks source link

detachInterrupt goes into an infinite loop #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Attach two or more interrupts
2. Try to detach the first interrupt you attached (or any other than the last 
one)

What is the expected output? What do you see instead?
detachInterrupt newer returns.

What version of the product are you using? On what operating system?
v1, Ubuntu 10.04, arduino-0.22

Please provide any additional information below.
The loop in the delPin function that fills the holes in the pcIntPins array 
does not increment the pointer t. Adding "t++" fixes the bug.
----------------------------------------------------------
                        do { // shuffle down as we pass through the list, filling the hole
                                *t = t[1];
                                t++; // this fixes the bug
                        } while (*t);

-----------------------------------------------------------

Original issue reported on code.google.com by pe...@netland.fi on 20 Oct 2011 at 8:25

GoogleCodeExporter commented 8 years ago
I assume this bug does not show up in the ReadReceiver example because that 
example only has one interrupt attached to one pin at a time?

Original comment by steve.ha...@gmail.com on 28 Nov 2011 at 6:44

GoogleCodeExporter commented 8 years ago
Thank you for this feedback.  This fix will be inserted into the next release 
of PinChangeInt.

Original comment by mschw...@gmail.com on 2 Dec 2011 at 3:22

GoogleCodeExporter commented 8 years ago
...Steve, you are correct.  The bug does not show up in the ReadReceiver 
example because there's only the one interrupt pin used.

Original comment by mschw...@gmail.com on 3 Dec 2011 at 5:58

GoogleCodeExporter commented 8 years ago
Fixed in v. 1.1.

Original comment by m...@schwager.com on 3 Dec 2011 at 6:17