예제 #1
0
        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();
                }
            }
        }
예제 #2
0
        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();
                }
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
파일: PIT.cs 프로젝트: Orvid/Cosmos
        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;
        }