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(); } }
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(); } }
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(); } }