mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 09:59:32 -06:00
Merge pull request #8985 from jordan-woyak/btemu-cleanup
BTEmu/Wiimote: Fixes and Cleanups.
This commit is contained in:
@ -1706,10 +1706,12 @@ void MainWindow::OnConnectWiiRemote(int id)
|
||||
if (!ios || SConfig::GetInstance().m_bt_passthrough_enabled)
|
||||
return;
|
||||
Core::RunAsCPUThread([&] {
|
||||
const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
|
||||
ios->GetDeviceByName("/dev/usb/oh1/57e/305"));
|
||||
const bool is_connected = bt && bt->AccessWiimoteByIndex(id)->IsConnected();
|
||||
Wiimote::Connect(id, !is_connected);
|
||||
if (const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
|
||||
ios->GetDeviceByName("/dev/usb/oh1/57e/305")))
|
||||
{
|
||||
const auto wm = bt->AccessWiimoteByIndex(id);
|
||||
wm->Activate(!wm->IsConnected());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user