Skip to content

Commit b2c7f4b

Browse files
committed
Optimization
1 parent b10101a commit b2c7f4b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

OpenVR/samples/driver_arduinohmd/driver_arduinohmd.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ void ArduinoIMURead()
175175
HMDInitCentring = true;
176176
}
177177
}
178+
179+
if (bytesRead == 0) Sleep(1);
178180
}
179181
}
180182

@@ -505,7 +507,7 @@ class CDeviceDriver : public vr::ITrackedDeviceServerDriver, public vr::IVRDispl
505507
}
506508

507509
// Centering
508-
if ((GetAsyncKeyState(m_centeringKey) & 0x8000) != 0 || ((GetAsyncKeyState(VK_CONTROL) & 0x8000) != 0 && (GetAsyncKeyState(VK_MENU) & 0x8000) != 0 && (GetAsyncKeyState('R') & 0x8000) != 0))
510+
if ( (GetAsyncKeyState(m_centeringKey) & 0x8000) != 0 || ( (GetAsyncKeyState(VK_CONTROL) & 0x8000) != 0 && (GetAsyncKeyState(VK_MENU) & 0x8000) != 0 && (GetAsyncKeyState('R') & 0x8000) != 0) )
509511
SetCentering();
510512

511513
// Set head tracking rotation

0 commit comments

Comments
 (0)