I’m not sure I get it. When I use you sample code the interrupt still isn’t hit. Presumable because they are on the same thread. When I put the Count in seperate thread my code doesn’t block and I can’t use Thread.Join because it is unavailable when using interruptPorts. Surely my problem should’nt be hard to solve. I just can’t get my head arround it.
All I want is this:
//pseudo code
DoSomethingHere();
GoCountPulsesAndWait(500); //Count pulses and wait for method to return
DoSomethingHere(); //Wait for previous method to finish before doing something else