Exemplo n.º 1
0
        public void EnablePin(GpioEnum pin)
        {
            lock (m_Pins)
            {
                if (!m_Pins.ContainsKey(pin))
                {
                    throw new UnauthorizedAccessException();
                }

                m_Pins[pin].Enabled = true;
            }

            // Make sure updates are running
            if (!m_Updater.IsStarted)
            {
                m_Updater.Start();
            }
        }
Exemplo n.º 2
0
        void IPwmControllerProvider.EnablePin(int pin)
        {
            if ((pin < 0) || (pin > (pinCount - 1)))
            {
                throw new ArgumentOutOfRangeException("pin");
            }

            lock (pins)
            {
                if (!pins.ContainsKey(pin))
                {
                    throw new UnauthorizedAccessException();
                }
                pins[pin].Enabled = true;
            }

            // Make sure updates are running
            if (!updater.IsStarted)
            {
                updater.Start();
            }
        }
Exemplo n.º 3
0
        private void TryStartUpdates()
        {
            // If we don't have a display or auto updates are false, ignore
            if ((display == null) || (autoUpdate == false))
            {
                return;
            }

            // Start the updater if not already started
            if (!updater.IsStarted)
            {
                updater.Start();
            }
        }