Esempio n. 1
0
        public override void Execute(PICController controller)
        {
            PICWatchDogTimer wdt = controller.GetWatchDog();

            wdt.Reset();

            if (controller.GetUnbankedRegisterBit(PICMemory.ADDR_OPTION, PICMemory.OPTION_BIT_PSA))
            {
                controller.SetUnbankedRegisterBit(PICMemory.ADDR_OPTION, PICMemory.OPTION_BIT_PS0, false);
                controller.SetUnbankedRegisterBit(PICMemory.ADDR_OPTION, PICMemory.OPTION_BIT_PS1, false);
                controller.SetUnbankedRegisterBit(PICMemory.ADDR_OPTION, PICMemory.OPTION_BIT_PS2, false);
            }

            controller.SetUnbankedRegisterBit(PICMemory.ADDR_STATUS, PICMemory.STATUS_BIT_TO, true);
            controller.SetUnbankedRegisterBit(PICMemory.ADDR_STATUS, PICMemory.STATUS_BIT_PD, false);

            controller.StartSleep();
        }