protected override void OnStart(string[] args) { if (IntelXhci.GetSupportState() != SupportState.Supported) { return; } _initialValue = IntelXhci.GetRouting(); IntelXhci.SwitchTo20(); _applied = true; }
private async Task StartTest() { if (BasicSupportState != SupportState.Supported) { return; } if (EhciControllersState != SupportState.Supported) { if (MessageBox.Show("EHCI controllers not detected - USB devices might stop working (including mouse and keyboard)\nIf this happens - just wait for 30s until timeout ends", "Warning", MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return; } } IntelXhci.SwitchTo20(); CanTest = false; TestRunning = true; TestCountdown = 30; do { await Task.Delay(TimeSpan.FromSeconds(1)); if (TestSuccess) { break; } TestCountdown -= 1; } while (TestCountdown > 0); if (TestSuccess) { return; } EndTest(); IntelXhci.SwitchTo30(); MessageBox.Show("Button not clicked in time - assuming that it didn't work well"); }