diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-05-15 12:03:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 12:03:08 -0400 |
commit | 033aa264cf07802b9b1a00754e8604eb852e1d3b (patch) | |
tree | d5ea9117790eef63c202372cfdd5099326012a26 /src/input_common/helpers/joycon_protocol/nfc.h | |
parent | 9087fe10e91385f705180c1b3048003b85b303ca (diff) | |
parent | ac531aa15f35b2e6584b8b306b5c3258ef66dc73 (diff) |
Merge pull request #10265 from german77/amiibo-lag
input_common: Make amiibo scanning less demanding
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/nfc.h')
-rw-r--r-- | src/input_common/helpers/joycon_protocol/nfc.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/input_common/helpers/joycon_protocol/nfc.h b/src/input_common/helpers/joycon_protocol/nfc.h index 11e263e07..4cb992d1d 100644 --- a/src/input_common/helpers/joycon_protocol/nfc.h +++ b/src/input_common/helpers/joycon_protocol/nfc.h @@ -32,6 +32,9 @@ public: bool IsEnabled() const; private: + // Number of times the function will be delayed until it outputs valid data + static constexpr std::size_t AMIIBO_UPDATE_DELAY = 15; + struct TagFoundData { u8 type; std::vector<u8> uuid; @@ -39,7 +42,7 @@ private: DriverResult WaitUntilNfcIsReady(); - DriverResult StartPolling(TagFoundData& data); + DriverResult StartPolling(TagFoundData& data, std::size_t timeout_limit = 1); DriverResult ReadTag(const TagFoundData& data); @@ -56,6 +59,7 @@ private: NFCReadBlockCommand GetReadBlockCommand(NFCPages pages) const; bool is_enabled{}; + std::size_t update_counter{}; }; } // namespace InputCommon::Joycon |