It's hard to see exactly what's going on here without the full code, but here are a few troubleshooting tips:
1. The data2 parameter passed into the interrupt function will hold the high/low state of the line when the interrupt is generated. When you're checking the InterruptMode...are you meaning to check the interrupt _state_?
2. Generally speaking, it's best to process interrupts and exit interrupt handlers as quickly as possible. Further interrupts can't be fired while you're in your handler, and if a lot of interrupts happen then the interrupt event queue will overflow and you'll lose interrupts.
Does that help get you on the right path?
- WriterGuy likes this