summaryrefslogtreecommitdiff
path: root/src/input_common/helpers/joycon_protocol/generic_functions.cpp
diff options
context:
space:
mode:
authorGravatar Narr the Reg2023-01-27 17:47:47 -0600
committerGravatar Narr the Reg2023-01-27 18:45:25 -0600
commit4e29afefc4afbce77f7ea0d110d7e844ce411eac (patch)
tree36348693dc5ef55813dfd57420d79bf0e5122c00 /src/input_common/helpers/joycon_protocol/generic_functions.cpp
parentinput_common: joycon: Remove magic numbers from calibration protocol (diff)
downloadyuzu-4e29afefc4afbce77f7ea0d110d7e844ce411eac.tar.gz
yuzu-4e29afefc4afbce77f7ea0d110d7e844ce411eac.tar.xz
yuzu-4e29afefc4afbce77f7ea0d110d7e844ce411eac.zip
input_common: joycon: Replace ReadSPI vector with span
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/generic_functions.cpp')
-rw-r--r--src/input_common/helpers/joycon_protocol/generic_functions.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input_common/helpers/joycon_protocol/generic_functions.cpp b/src/input_common/helpers/joycon_protocol/generic_functions.cpp
index 4763ba3e6..484c208e6 100644
--- a/src/input_common/helpers/joycon_protocol/generic_functions.cpp
+++ b/src/input_common/helpers/joycon_protocol/generic_functions.cpp
@@ -71,8 +71,8 @@ DriverResult GenericProtocol::GetBattery(u32& battery_level) {
71 71
72DriverResult GenericProtocol::GetColor(Color& color) { 72DriverResult GenericProtocol::GetColor(Color& color) {
73 ScopedSetBlocking sb(this); 73 ScopedSetBlocking sb(this);
74 std::vector<u8> buffer; 74 std::array<u8, 12> buffer{};
75 const auto result = ReadSPI(SpiAddress::COLOR_DATA, 12, buffer); 75 const auto result = ReadRawSPI(SpiAddress::COLOR_DATA, buffer);
76 76
77 color = {}; 77 color = {};
78 if (result == DriverResult::Success) { 78 if (result == DriverResult::Success) {
@@ -87,8 +87,8 @@ DriverResult GenericProtocol::GetColor(Color& color) {
87 87
88DriverResult GenericProtocol::GetSerialNumber(SerialNumber& serial_number) { 88DriverResult GenericProtocol::GetSerialNumber(SerialNumber& serial_number) {
89 ScopedSetBlocking sb(this); 89 ScopedSetBlocking sb(this);
90 std::vector<u8> buffer; 90 std::array<u8, 16> buffer{};
91 const auto result = ReadSPI(SpiAddress::SERIAL_NUMBER, 16, buffer); 91 const auto result = ReadRawSPI(SpiAddress::SERIAL_NUMBER, buffer);
92 92
93 serial_number = {}; 93 serial_number = {};
94 if (result == DriverResult::Success) { 94 if (result == DriverResult::Success) {