|
|
@ -262,6 +262,16 @@ DriverResult JoyconDriver::SetPollingMode() {
|
|
|
|
irs_protocol->DisableIrs();
|
|
|
|
irs_protocol->DisableIrs();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nfc_protocol->IsEnabled()) {
|
|
|
|
|
|
|
|
amiibo_detected = false;
|
|
|
|
|
|
|
|
nfc_protocol->DisableNfc();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ring_protocol->IsEnabled()) {
|
|
|
|
|
|
|
|
ring_connected = false;
|
|
|
|
|
|
|
|
ring_protocol->DisableRingCon();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (irs_enabled && supported_features.irs) {
|
|
|
|
if (irs_enabled && supported_features.irs) {
|
|
|
|
auto result = irs_protocol->EnableIrs();
|
|
|
|
auto result = irs_protocol->EnableIrs();
|
|
|
|
if (result == DriverResult::Success) {
|
|
|
|
if (result == DriverResult::Success) {
|
|
|
@ -272,11 +282,6 @@ DriverResult JoyconDriver::SetPollingMode() {
|
|
|
|
LOG_ERROR(Input, "Error enabling IRS");
|
|
|
|
LOG_ERROR(Input, "Error enabling IRS");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (nfc_protocol->IsEnabled()) {
|
|
|
|
|
|
|
|
amiibo_detected = false;
|
|
|
|
|
|
|
|
nfc_protocol->DisableNfc();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nfc_enabled && supported_features.nfc) {
|
|
|
|
if (nfc_enabled && supported_features.nfc) {
|
|
|
|
auto result = nfc_protocol->EnableNfc();
|
|
|
|
auto result = nfc_protocol->EnableNfc();
|
|
|
|
if (result == DriverResult::Success) {
|
|
|
|
if (result == DriverResult::Success) {
|
|
|
@ -290,11 +295,6 @@ DriverResult JoyconDriver::SetPollingMode() {
|
|
|
|
LOG_ERROR(Input, "Error enabling NFC");
|
|
|
|
LOG_ERROR(Input, "Error enabling NFC");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (ring_protocol->IsEnabled()) {
|
|
|
|
|
|
|
|
ring_connected = false;
|
|
|
|
|
|
|
|
ring_protocol->DisableRingCon();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hidbus_enabled && supported_features.hidbus) {
|
|
|
|
if (hidbus_enabled && supported_features.hidbus) {
|
|
|
|
auto result = ring_protocol->EnableRingCon();
|
|
|
|
auto result = ring_protocol->EnableRingCon();
|
|
|
|
if (result == DriverResult::Success) {
|
|
|
|
if (result == DriverResult::Success) {
|
|
|
@ -418,6 +418,12 @@ DriverResult JoyconDriver::SetPasiveMode() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DriverResult JoyconDriver::SetActiveMode() {
|
|
|
|
DriverResult JoyconDriver::SetActiveMode() {
|
|
|
|
|
|
|
|
if (is_ring_disabled_by_irs) {
|
|
|
|
|
|
|
|
is_ring_disabled_by_irs = false;
|
|
|
|
|
|
|
|
SetActiveMode();
|
|
|
|
|
|
|
|
return SetRingConMode();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::scoped_lock lock{mutex};
|
|
|
|
std::scoped_lock lock{mutex};
|
|
|
|
motion_enabled = true;
|
|
|
|
motion_enabled = true;
|
|
|
|
hidbus_enabled = false;
|
|
|
|
hidbus_enabled = false;
|
|
|
@ -434,6 +440,10 @@ DriverResult JoyconDriver::SetIrMode() {
|
|
|
|
return DriverResult::NotSupported;
|
|
|
|
return DriverResult::NotSupported;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ring_connected) {
|
|
|
|
|
|
|
|
is_ring_disabled_by_irs = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
motion_enabled = false;
|
|
|
|
motion_enabled = false;
|
|
|
|
hidbus_enabled = false;
|
|
|
|
hidbus_enabled = false;
|
|
|
|
nfc_enabled = false;
|
|
|
|
nfc_enabled = false;
|
|
|
|