From 47859ad40cd32e721803230eb587d1d14ee5d0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Tue, 12 Jul 2016 16:50:41 +0200 Subject: [PATCH] WiimoteReal: Call Update() less often This moves back the WiimoteScanner:Update() call to where it originally was, since according to a comment it is intended to be called only when "when not looking for more Wiimotes", and calling it too often causes the Bluetooth module to be loaded/unloaded a lot of times. --- Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp index 8994695fd3..df8e65d0f2 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp @@ -472,7 +472,6 @@ void WiimoteScanner::ThreadFunc() { m_scan_mode_changed_event.WaitFor(std::chrono::milliseconds(500)); - Update(); // Does stuff needed to detect disconnects on Windows CheckForDisconnectedWiimotes(); if (m_scan_mode.load() == WiimoteScanMode::DO_NOT_SCAN) @@ -490,6 +489,10 @@ void WiimoteScanner::ThreadFunc() TryToConnectBalanceBoard(found_board); } } + else + { + Update(); // Does stuff needed to detect disconnects on Windows + } if (m_scan_mode.load() == WiimoteScanMode::SCAN_ONCE) m_scan_mode.store(WiimoteScanMode::DO_NOT_SCAN);