public void HandleInterrupt() { int T0Delay = (int)T0DelyNS; PITTimer hndlr = null; for (int i = ActiveHandlers.Count - 1; i >= 0; i--) { hndlr = ActiveHandlers[i]; hndlr.NSRemaining -= T0Delay; if (hndlr.NSRemaining < 1) { if (hndlr.Recuring) { hndlr.NSRemaining = hndlr.NanosecondsTimeout; } else { hndlr.ID = -1; ActiveHandlers.RemoveAt(i); } hndlr.HandleTrigger(); } } }
private void HandleIRQ(ref INTs.IRQContext aContext) { int T0Delay = (int)T0DelyNS; PITTimer hndlr = null; if (ActiveHandlers.Count > 0) { T0Countdown = 65535; } for (int i = ActiveHandlers.Count - 1; i >= 0; i--) { hndlr = ActiveHandlers[i]; hndlr.NSRemaining -= T0Delay; if (hndlr.NSRemaining < 1) { if (hndlr.Recuring) { hndlr.NSRemaining = hndlr.NanosecondsTimeout; } else { hndlr.ID = -1; ActiveHandlers.RemoveAt(i); } hndlr.HandleTrigger(); } } }
public int RegisterTimer(PITTimer timer) { if (timer.ID != -1) { throw new InvalidOperationException("Timer has already been registered!"); } timer.ID = (TimerCounter++); ActiveHandlers.Add(timer); T0Countdown = 65535; return(timer.ID); }
public int RegisterTimer(PITTimer timer) { if (timer.ID != -1) throw new InvalidOperationException("Timer has already been registered!"); timer.ID = (TimerCounter++); ActiveHandlers.Add(timer); return timer.ID; }