This commit is contained in:
Tilka 2024-03-07 20:03:54 -05:00 committed by GitHub
commit f39ba24e19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 7 deletions

View File

@ -708,15 +708,19 @@ void WiimoteScanner::ThreadFunc()
g_controller_interface.PlatformPopulateDevices([] { ProcessWiimotePool(); });
}
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
for (const auto& backend : m_backends)
backend->Update();
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 (!Config::Get(Config::MAIN_CONNECT_WIIMOTES_FOR_CONTROLLER_INTERFACE))
{
@ -761,10 +765,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);
}
{