mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 10:51:50 -05:00
input_common: Allow timeouts to happen while scanning for a ring
This commit is contained in:
parent
df9685a21c
commit
ac755476cd
2 changed files with 4 additions and 3 deletions
|
@ -75,7 +75,7 @@ Common::Input::DriverResult JoyconCommonProtocol::SendRawData(std::span<const u8
|
||||||
Common::Input::DriverResult JoyconCommonProtocol::GetSubCommandResponse(
|
Common::Input::DriverResult JoyconCommonProtocol::GetSubCommandResponse(
|
||||||
SubCommand sc, SubCommandResponse& output) {
|
SubCommand sc, SubCommandResponse& output) {
|
||||||
constexpr int timeout_mili = 66;
|
constexpr int timeout_mili = 66;
|
||||||
constexpr int MaxTries = 3;
|
constexpr int MaxTries = 10;
|
||||||
int tries = 0;
|
int tries = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -70,7 +70,7 @@ Common::Input::DriverResult RingConProtocol::StartRingconPolling() {
|
||||||
|
|
||||||
Common::Input::DriverResult RingConProtocol::IsRingConnected(bool& is_connected) {
|
Common::Input::DriverResult RingConProtocol::IsRingConnected(bool& is_connected) {
|
||||||
LOG_DEBUG(Input, "IsRingConnected");
|
LOG_DEBUG(Input, "IsRingConnected");
|
||||||
constexpr std::size_t max_tries = 28;
|
constexpr std::size_t max_tries = 42;
|
||||||
SubCommandResponse output{};
|
SubCommandResponse output{};
|
||||||
std::size_t tries = 0;
|
std::size_t tries = 0;
|
||||||
is_connected = false;
|
is_connected = false;
|
||||||
|
@ -78,7 +78,8 @@ Common::Input::DriverResult RingConProtocol::IsRingConnected(bool& is_connected)
|
||||||
do {
|
do {
|
||||||
const auto result = SendSubCommand(SubCommand::GET_EXTERNAL_DEVICE_INFO, {}, output);
|
const auto result = SendSubCommand(SubCommand::GET_EXTERNAL_DEVICE_INFO, {}, output);
|
||||||
|
|
||||||
if (result != Common::Input::DriverResult::Success) {
|
if (result != Common::Input::DriverResult::Success &&
|
||||||
|
result != Common::Input::DriverResult::Timeout) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue