Ejemplo n.º 1
0
        internal byte Initialize()
        {
            DebugStub.Print("RTClock: initialize\n");

            rps = timer.rps;

            // Turn oscillator on, but disable and clear interrupts
            if (Processor.SamplingEnabled())
            {
                WriteRtc(DS1287_A, DS1287_A_DIVON | DS1287_A_SAMPLING_HZ);
            }
            else
            {
                WriteRtc(DS1287_A, DS1287_A_DIVON | DS1287_A_64HZ);
            }
            WriteRtc(DS1287_B, DS1287_B_24H | DS1287_B_DF_BCD);
            ReadRtc(DS1287_C);  // Clear any update bits

            if ((ReadRtc(DS1287_D) & DS1287_D_VRT) == 0)
            {
                DebugStub.Print("RTClock weak or defective power source.\n");
            }

            rtcBootTime = PullRtcTime().Ticks;

            // Enable and clear interrupts
            // NB it may take 500ms for first interrupt to be generated.
            pic.EnableIrq(irq);
            return(pic.IrqToInterrupt(irq));
        }
Ejemplo n.º 2
0
        public byte Initialize()
        {
#if VERBOSE
            Tracing.Log(Tracing.Debug, "Timer.Initialize()");
#endif

            rps = new RtcPitState();
            Stop();
            DoPitPerformanceTests();

            pic.EnableIrq(irq);
            return(pic.IrqToInterrupt(irq));
        }
Ejemplo n.º 3
0
        public byte Initialize()
        {
#if VERBOSE
            DebugStub.WriteLine("Timer.Initialize()");
#endif

            SetOneShot();
            SetInterruptEnabled(false);
            Stop();

            pic.EnableIrq(irq);
            return(pic.IrqToInterrupt(irq));
        }
Ejemplo n.º 4
0
 public override void EnableIoInterrupt(byte irq)
 {
     pic.EnableIrq(irq);
 }