WiimoteReal: actually stop continuous scanning
This commit is contained in:
parent
e0b64e0ef8
commit
f1ae85282c
|
@ -669,15 +669,19 @@ void WiimoteScanner::ThreadFunc()
|
||||||
{
|
{
|
||||||
m_scan_mode_changed_event.WaitFor(std::chrono::milliseconds(500));
|
m_scan_mode_changed_event.WaitFor(std::chrono::milliseconds(500));
|
||||||
|
|
||||||
|
if (m_scan_mode.load() == WiimoteScanMode::DO_NOT_SCAN)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Stop scanning if not in continous mode.
|
||||||
|
auto scan_mode = WiimoteScanMode::SCAN_ONCE;
|
||||||
|
m_scan_mode.compare_exchange_strong(scan_mode, WiimoteScanMode::DO_NOT_SCAN);
|
||||||
|
|
||||||
// Does stuff needed to detect disconnects on Windows
|
// Does stuff needed to detect disconnects on Windows
|
||||||
for (const auto& backend : m_backends)
|
for (const auto& backend : m_backends)
|
||||||
backend->Update();
|
backend->Update();
|
||||||
|
|
||||||
CheckForDisconnectedWiimotes();
|
CheckForDisconnectedWiimotes();
|
||||||
|
|
||||||
if (m_scan_mode.load() == WiimoteScanMode::DO_NOT_SCAN)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// If we don't want Wiimotes in ControllerInterface, we may not need them at all.
|
// If we don't want Wiimotes in ControllerInterface, we may not need them at all.
|
||||||
if (!SConfig::GetInstance().connect_wiimotes_for_ciface)
|
if (!SConfig::GetInstance().connect_wiimotes_for_ciface)
|
||||||
{
|
{
|
||||||
|
@ -722,10 +726,6 @@ void WiimoteScanner::ThreadFunc()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop scanning if not in continous mode.
|
|
||||||
auto scan_mode = WiimoteScanMode::SCAN_ONCE;
|
|
||||||
m_scan_mode.compare_exchange_strong(scan_mode, WiimoteScanMode::DO_NOT_SCAN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue