// Construct the object. Set this class to handle the emulated
            // hardware's button interrupts.
            public ButtonPad(GPIOButtonInputProvider sink, Button button, Cpu.Pin pin)
            {
                this.sink = sink;
                this.button = button;

                // When this GPIO pin is true, call the Interrupt method.
                port = new InterruptPort(pin, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);
                port.OnInterrupt += new GPIOInterruptEventHandler(this.Interrupt);
            }
            // Construct the object. Set this class to handle the emulated
            // hardware's button interrupts.
            public ButtonPad(GPIOButtonInputProvider sink, Button button, Cpu.Pin pin)
            {
                this.sink   = sink;
                this.button = button;

                // When this GPIO pin is true, call the Interrupt method.
                port              = new InterruptPort(pin, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);
                port.OnInterrupt += new GPIOInterruptEventHandler(this.Interrupt);
            }
Esempio n. 3
0
        private TetrisApp()
        {
            // Create the object that configures the GPIO pins to buttons.
            GPIOButtonInputProvider inputProvider = new GPIOButtonInputProvider(null);

            // Create ExtendedWeakReference for high score table
            highScoreEWD = ExtendedWeakReference.RecoverOrCreate(
                                                    typeof(TetrisApp),
                                                    0,
                                                    ExtendedWeakReference.c_SurvivePowerdown);
            // Set persistance priority
            highScoreEWD.Priority = (int)ExtendedWeakReference.PriorityLevel.Important;

            // Try to recover previously saved HighScore
            HighScore = (HighScoreTable)highScoreEWD.Target;

            // If nothing was recovered - create new
            if (HighScore == null)
                HighScore = new HighScoreTable();
        }
Esempio n. 4
0
        private TetrisApp()
        {
            // Create the object that configures the GPIO pins to buttons.
            GPIOButtonInputProvider inputProvider = new GPIOButtonInputProvider(null);

            // Create ExtendedWeakReference for high score table
            highScoreEWD = ExtendedWeakReference.RecoverOrCreate(
                typeof(TetrisApp),
                0,
                ExtendedWeakReference.c_SurvivePowerdown);
            // Set persistance priority
            highScoreEWD.Priority = (int)ExtendedWeakReference.PriorityLevel.Important;

            // Try to recover previously saved HighScore
            HighScore = (HighScoreTable)highScoreEWD.Target;

            // If nothing was recovered - create new
            if (HighScore == null)
            {
                HighScore = new HighScoreTable();
            }
        }