i cant understand what is going on here and was wondering if someone could help me.
I've setup 2 two inputs to interrupt on ports D0 & D1
BallTrigOdd = new InterruptPort(NPIO.BallTrigOdd, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);BallTrigOdd.OnInterrupt += new NativeEventHandler(BallTrigOdd_OnInterrupt);BallTrigOdd.EnableInterrupt();BallTrigEven = new InterruptPort(NPIO.BallTrigEven, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);BallTrigEven.OnInterrupt += new NativeEventHandler(BallTrigEven_OnInterrupt);BallTrigEven.EnableInterrupt();
private void BallTrigEven_OnInterrupt(uint data1, uint data2, DateTime time) { BallTrigEven.DisableInterrupt(); UpdateStatus(id.odd); Cycle(id.even); ballData.Lanes[(int)id.even].Data = (int)TestScores.Seven; BallTrigEven.EnableInterrupt(); } private void BallTrigOdd_OnInterrupt(uint data1, uint data2, DateTime time) { BallTrigOdd.DisableInterrupt(); UpdateStatus(id.even); Cycle(id.odd); ballData.Lanes[(int)id.even].Data = (int)TestScores.Seven; BallTrigOdd.EnableInterrupt(); }
but for some reason it just keeps triggering and gets stuck in a loop. Is there something I'm doing wrong?