diff --git a/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteReal/WiimoteReal.cpp b/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteReal/WiimoteReal.cpp index 867d40f1f8..5046f6f54e 100644 --- a/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteReal/WiimoteReal.cpp +++ b/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteReal/WiimoteReal.cpp @@ -30,6 +30,7 @@ // used for pair up #ifdef _WIN32 +#include #include #pragma comment(lib, "Bthprops.lib") #endif @@ -482,9 +483,12 @@ THREAD_RETURN WiimoteThreadFunc(void* arg) // main loop while (g_run_wiimote_thread) { - wiimote->Write(); + // hopefully this is alright + while (wiimote->Write()) {} + + // sleep if there was nothing to read if (false == wiimote->Read()) - Common::SleepCurrentThread(1); // sleep if there was nothing to read + Common::SleepCurrentThread(1); } return 0;