summaryrefslogtreecommitdiff
path: root/src/input_common/helpers/joycon_protocol/nfc.h
diff options
context:
space:
mode:
authorGravatar german772023-05-13 00:04:18 -0600
committerGravatar german772023-05-14 09:04:37 -0600
commitac531aa15f35b2e6584b8b306b5c3258ef66dc73 (patch)
treeda0924d367e338345a22449e64fc01e474c2d2c3 /src/input_common/helpers/joycon_protocol/nfc.h
parentMerge pull request #10244 from liamwhite/lower-upper (diff)
downloadyuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.tar.gz
yuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.tar.xz
yuzu-ac531aa15f35b2e6584b8b306b5c3258ef66dc73.zip
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.h6
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:
32 bool IsEnabled() const; 32 bool IsEnabled() const;
33 33
34private: 34private:
35 // Number of times the function will be delayed until it outputs valid data
36 static constexpr std::size_t AMIIBO_UPDATE_DELAY = 15;
37
35 struct TagFoundData { 38 struct TagFoundData {
36 u8 type; 39 u8 type;
37 std::vector<u8> uuid; 40 std::vector<u8> uuid;
@@ -39,7 +42,7 @@ private:
39 42
40 DriverResult WaitUntilNfcIsReady(); 43 DriverResult WaitUntilNfcIsReady();
41 44
42 DriverResult StartPolling(TagFoundData& data); 45 DriverResult StartPolling(TagFoundData& data, std::size_t timeout_limit = 1);
43 46
44 DriverResult ReadTag(const TagFoundData& data); 47 DriverResult ReadTag(const TagFoundData& data);
45 48
@@ -56,6 +59,7 @@ private:
56 NFCReadBlockCommand GetReadBlockCommand(NFCPages pages) const; 59 NFCReadBlockCommand GetReadBlockCommand(NFCPages pages) const;
57 60
58 bool is_enabled{}; 61 bool is_enabled{};
62 std::size_t update_counter{};
59}; 63};
60 64
61} // namespace InputCommon::Joycon 65} // namespace InputCommon::Joycon