diff --git a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm index 93eeb03357..dc01e7841e 100644 --- a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm +++ b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm @@ -70,7 +70,7 @@ extern "C" OSErr UpdateSystemActivity(UInt8 activity); memcpy(wm->input, data, length); wm->inputlen = length; - CFRunLoopStop(CFRunLoopGetCurrent()); + (void)wm->Read(); (void)UpdateSystemActivity(1); } @@ -125,7 +125,7 @@ int FindWiimotes(Wiimote **wm, int max_wiimotes) } sbt = [[SearchBT alloc] init]; - sbt->maxDevices = max_wiimotes; + sbt->maxDevices = max_wiimotes - found_wiimotes; bti = [[IOBluetoothDeviceInquiry alloc] init]; [bti setDelegate: sbt]; [bti setInquiryLength: 5]; @@ -226,11 +226,6 @@ int Wiimote::IORead(unsigned char *buf) if (!IsConnected()) return 0; - if (inputlen == 0) { - CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, true); - return 0; - } - bytes = inputlen; memcpy(buf, input, bytes); inputlen = 0; diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp index b75bd0cd6b..f08d50c088 100644 --- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp @@ -543,8 +543,10 @@ THREAD_RETURN WiimoteThreadFunc(void* arg) // hopefully this is alright while (wiimote->Write()) {} +#ifndef __APPLE__ // sleep if there was nothing to read if (false == wiimote->Read()) +#endif Common::SleepCurrentThread(1); }