diff options
author | german77 <juangerman-13@hotmail.com> | 2023-05-13 08:04:18 +0200 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-05-14 17:04:37 +0200 |
commit | ac531aa15f35b2e6584b8b306b5c3258ef66dc73 (patch) | |
tree | da0924d367e338345a22449e64fc01e474c2d2c3 /src/input_common/helpers/joycon_protocol/nfc.cpp | |
parent | Merge pull request #10244 from liamwhite/lower-upper (diff) | |
download | yuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.tar yuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.tar.gz yuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.tar.bz2 yuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.tar.lz yuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.tar.xz yuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.tar.zst yuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.zip |
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/nfc.cpp')
-rw-r--r-- | src/input_common/helpers/joycon_protocol/nfc.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/input_common/helpers/joycon_protocol/nfc.cpp b/src/input_common/helpers/joycon_protocol/nfc.cpp index 77ea6d5cf..14818ae33 100644 --- a/src/input_common/helpers/joycon_protocol/nfc.cpp +++ b/src/input_common/helpers/joycon_protocol/nfc.cpp @@ -72,6 +72,11 @@ DriverResult NfcProtocol::StartNFCPollingMode() { } DriverResult NfcProtocol::ScanAmiibo(std::vector<u8>& data) { + if (update_counter++ < AMIIBO_UPDATE_DELAY) { + return DriverResult::Delayed; + } + update_counter = 0; + LOG_DEBUG(Input, "Start NFC pooling Mode"); ScopedSetBlocking sb(this); DriverResult result{DriverResult::Success}; @@ -87,7 +92,7 @@ DriverResult NfcProtocol::ScanAmiibo(std::vector<u8>& data) { result = WaitUntilNfcIsReady(); } if (result == DriverResult::Success) { - result = StartPolling(tag_data); + result = StartPolling(tag_data, 7); } if (result == DriverResult::Success) { result = GetAmiiboData(data); @@ -129,9 +134,8 @@ DriverResult NfcProtocol::WaitUntilNfcIsReady() { return DriverResult::Success; } -DriverResult NfcProtocol::StartPolling(TagFoundData& data) { +DriverResult NfcProtocol::StartPolling(TagFoundData& data, std::size_t timeout_limit) { LOG_DEBUG(Input, "Start Polling for tag"); - constexpr std::size_t timeout_limit = 7; MCUCommandResponse output{}; std::size_t tries = 0; |