diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-06 07:11:24 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-06 07:11:24 +0200 |
commit | d2076ff5deb2046d1f8bcd2d324e5cd917c3871d (patch) | |
tree | e9b28e66f397bfa5692dddeb8aa8ed588f7b72bc | |
parent | 2bcab030f7640387e015f232df6254e1806aa586 (diff) |
simconnect: increase timer precision just to be safe
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c45163dc..448375f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,7 +304,7 @@ endif() if(SDK_SIMCONNECT) opentrack_library(opentrack-proto-simconnect ftnoir_protocol_sc) - target_link_libraries(opentrack-proto-simconnect ${SDK_SIMCONNECT}/lib/SimConnect.lib) + target_link_libraries(opentrack-proto-simconnect ${SDK_SIMCONNECT}/lib/SimConnect.lib winmm) include_directories(opentrack-proto-simconnect SYSTEM PUBLIC ${SDK_SIMCONNECT}/inc) endif() diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp index eb8d1a79..f767d232 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp @@ -44,6 +44,8 @@ void FTNoIR_Protocol::run() { Affinity thr; + (void) timeBeginPeriod(1); + while (!should_stop) { if (SUCCEEDED(simconnect_open(&hSimConnect, "opentrack", NULL, 0, 0, 0))) @@ -54,7 +56,7 @@ void FTNoIR_Protocol::run() { if (FAILED(simconnect_calldispatch(hSimConnect, processNextSimconnectEvent, reinterpret_cast<void*>(this)))) break; - Sleep(1); + Sleep(3); } (void) simconnect_close(hSimConnect); @@ -62,6 +64,8 @@ void FTNoIR_Protocol::run() Sleep(100); } + + (void) timeEndPeriod(1); } void FTNoIR_Protocol::pose( const double *headpose ) { |