Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Multi threaded the startup headset configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gusmanb committed Nov 3, 2016
1 parent 7c0756b commit 0537efa
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions PSVRToolbox/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,19 @@ private void detectTimer_Tick(object sender, EventArgs e)
{
detectTimer.Enabled = false;
vrSet = new PSVR(Settings.Instance.UseLibUSB);
vrSet.SensorDataUpdate += VrSet_SensorDataUpdate;
vrSet.Removed += VrSet_Removed;
vrSet.SendCommand(PSVRCommand.GetHeadsetOn());
vrSet.SendCommand(PSVRCommand.GetEnterVRMode());
Thread.Sleep(1500);
vrSet.SendCommand(PSVRCommand.GetExitVRMode());
Thread.Sleep(1500);
ApplyCinematicSettings();

Task.Run(() =>
{
vrSet.SensorDataUpdate += VrSet_SensorDataUpdate;
vrSet.Removed += VrSet_Removed;
vrSet.SendCommand(PSVRCommand.GetHeadsetOn());
vrSet.SendCommand(PSVRCommand.GetEnterVRMode());
Thread.Sleep(1500);
vrSet.SendCommand(PSVRCommand.GetExitVRMode());
Thread.Sleep(1500);
ApplyCinematicSettings();
});

lblStatus.Text = "VR set found";
grpFunctions.Enabled = true;
grpCinematic.Enabled = true;
Expand Down

0 comments on commit 0537efa

Please sign in to comment.