diff options
author | arades79 <scravers@protonmail.com> | 2023-02-11 19:28:03 +0100 |
---|---|---|
committer | arades79 <scravers@protonmail.com> | 2023-02-14 18:33:11 +0100 |
commit | 45e13b03f372230dbf780f3fa87dd88f388af605 (patch) | |
tree | 555593e7e5016b6ba2a777d7417ada244abce458 /src/input_common/helpers/joycon_protocol | |
parent | Merge pull request #9795 from Kelebek1/biquad_fix (diff) | |
download | yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.gz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.bz2 yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.lz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.xz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.zst yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.zip |
Diffstat (limited to 'src/input_common/helpers/joycon_protocol')
5 files changed, 21 insertions, 21 deletions
diff --git a/src/input_common/helpers/joycon_protocol/calibration.cpp b/src/input_common/helpers/joycon_protocol/calibration.cpp index d8f040f75..69e3379cf 100644 --- a/src/input_common/helpers/joycon_protocol/calibration.cpp +++ b/src/input_common/helpers/joycon_protocol/calibration.cpp @@ -129,7 +129,7 @@ DriverResult CalibrationProtocol::GetImuCalibration(MotionCalibration& calibrati DriverResult CalibrationProtocol::GetRingCalibration(RingCalibration& calibration, s16 current_value) { - constexpr s16 DefaultRingRange{800}; + constexpr static s16 DefaultRingRange{800}; // TODO: Get default calibration form ring itself if (ring_data_max == 0 && ring_data_min == 0) { @@ -168,8 +168,8 @@ u16 CalibrationProtocol::GetYAxisCalibrationValue(std::span<u8> block) const { } void CalibrationProtocol::ValidateCalibration(JoyStickCalibration& calibration) { - constexpr u16 DefaultStickCenter{0x800}; - constexpr u16 DefaultStickRange{0x6cc}; + constexpr static u16 DefaultStickCenter{0x800}; + constexpr static u16 DefaultStickRange{0x6cc}; calibration.x.center = ValidateValue(calibration.x.center, DefaultStickCenter); calibration.x.max = ValidateValue(calibration.x.max, DefaultStickRange); @@ -181,9 +181,9 @@ void CalibrationProtocol::ValidateCalibration(JoyStickCalibration& calibration) } void CalibrationProtocol::ValidateCalibration(MotionCalibration& calibration) { - constexpr s16 DefaultAccelerometerScale{0x4000}; - constexpr s16 DefaultGyroScale{0x3be7}; - constexpr s16 DefaultOffset{0}; + constexpr static s16 DefaultAccelerometerScale{0x4000}; + constexpr static s16 DefaultGyroScale{0x3be7}; + constexpr static s16 DefaultOffset{0}; for (auto& sensor : calibration.accelerometer) { sensor.scale = ValidateValue(sensor.scale, DefaultAccelerometerScale); diff --git a/src/input_common/helpers/joycon_protocol/common_protocol.cpp b/src/input_common/helpers/joycon_protocol/common_protocol.cpp index 2b42a4555..95c3923b0 100644 --- a/src/input_common/helpers/joycon_protocol/common_protocol.cpp +++ b/src/input_common/helpers/joycon_protocol/common_protocol.cpp @@ -72,8 +72,8 @@ DriverResult JoyconCommonProtocol::SendRawData(std::span<const u8> buffer) { DriverResult JoyconCommonProtocol::GetSubCommandResponse(SubCommand sc, SubCommandResponse& output) { - constexpr int timeout_mili = 66; - constexpr int MaxTries = 15; + constexpr static int timeout_mili = 66; + constexpr static int MaxTries = 15; int tries = 0; do { @@ -157,8 +157,8 @@ DriverResult JoyconCommonProtocol::SendVibrationReport(std::span<const u8> buffe } DriverResult JoyconCommonProtocol::ReadRawSPI(SpiAddress addr, std::span<u8> output) { - constexpr std::size_t HeaderSize = 5; - constexpr std::size_t MaxTries = 10; + constexpr static std::size_t HeaderSize = 5; + constexpr static std::size_t MaxTries = 10; std::size_t tries = 0; SubCommandResponse response{}; std::array<u8, sizeof(ReadSpiPacket)> buffer{}; @@ -216,8 +216,8 @@ DriverResult JoyconCommonProtocol::ConfigureMCU(const MCUConfig& config) { DriverResult JoyconCommonProtocol::GetMCUDataResponse(ReportMode report_mode, MCUCommandResponse& output) { - constexpr int TimeoutMili = 200; - constexpr int MaxTries = 9; + constexpr static int TimeoutMili = 200; + constexpr static int MaxTries = 9; int tries = 0; do { @@ -265,7 +265,7 @@ DriverResult JoyconCommonProtocol::SendMCUData(ReportMode report_mode, SubComman DriverResult JoyconCommonProtocol::WaitSetMCUMode(ReportMode report_mode, MCUMode mode) { MCUCommandResponse output{}; - constexpr std::size_t MaxTries{8}; + constexpr static std::size_t MaxTries{8}; std::size_t tries{}; do { diff --git a/src/input_common/helpers/joycon_protocol/irs.cpp b/src/input_common/helpers/joycon_protocol/irs.cpp index 731fd5981..5c07f698b 100644 --- a/src/input_common/helpers/joycon_protocol/irs.cpp +++ b/src/input_common/helpers/joycon_protocol/irs.cpp @@ -131,7 +131,7 @@ DriverResult IrsProtocol::RequestImage(std::span<u8> buffer) { DriverResult IrsProtocol::ConfigureIrs() { LOG_DEBUG(Input, "Configure IRS"); - constexpr std::size_t max_tries = 28; + constexpr static std::size_t max_tries = 28; SubCommandResponse output{}; std::size_t tries = 0; @@ -166,7 +166,7 @@ DriverResult IrsProtocol::ConfigureIrs() { DriverResult IrsProtocol::WriteRegistersStep1() { LOG_DEBUG(Input, "WriteRegistersStep1"); DriverResult result{DriverResult::Success}; - constexpr std::size_t max_tries = 28; + constexpr static std::size_t max_tries = 28; SubCommandResponse output{}; std::size_t tries = 0; @@ -226,7 +226,7 @@ DriverResult IrsProtocol::WriteRegistersStep1() { DriverResult IrsProtocol::WriteRegistersStep2() { LOG_DEBUG(Input, "WriteRegistersStep2"); - constexpr std::size_t max_tries = 28; + constexpr static std::size_t max_tries = 28; SubCommandResponse output{}; std::size_t tries = 0; diff --git a/src/input_common/helpers/joycon_protocol/nfc.cpp b/src/input_common/helpers/joycon_protocol/nfc.cpp index eeba82986..6b8f38aec 100644 --- a/src/input_common/helpers/joycon_protocol/nfc.cpp +++ b/src/input_common/helpers/joycon_protocol/nfc.cpp @@ -109,7 +109,7 @@ bool NfcProtocol::HasAmiibo() { } DriverResult NfcProtocol::WaitUntilNfcIsReady() { - constexpr std::size_t timeout_limit = 10; + constexpr static std::size_t timeout_limit = 10; MCUCommandResponse output{}; std::size_t tries = 0; @@ -131,7 +131,7 @@ DriverResult NfcProtocol::WaitUntilNfcIsReady() { DriverResult NfcProtocol::StartPolling(TagFoundData& data) { LOG_DEBUG(Input, "Start Polling for tag"); - constexpr std::size_t timeout_limit = 7; + constexpr static std::size_t timeout_limit = 7; MCUCommandResponse output{}; std::size_t tries = 0; @@ -155,7 +155,7 @@ DriverResult NfcProtocol::StartPolling(TagFoundData& data) { } DriverResult NfcProtocol::ReadTag(const TagFoundData& data) { - constexpr std::size_t timeout_limit = 10; + constexpr static std::size_t timeout_limit = 10; MCUCommandResponse output{}; std::size_t tries = 0; @@ -224,7 +224,7 @@ DriverResult NfcProtocol::ReadTag(const TagFoundData& data) { } DriverResult NfcProtocol::GetAmiiboData(std::vector<u8>& ntag_data) { - constexpr std::size_t timeout_limit = 10; + constexpr static std::size_t timeout_limit = 10; MCUCommandResponse output{}; std::size_t tries = 0; diff --git a/src/input_common/helpers/joycon_protocol/ringcon.cpp b/src/input_common/helpers/joycon_protocol/ringcon.cpp index 190cef812..9056e64dc 100644 --- a/src/input_common/helpers/joycon_protocol/ringcon.cpp +++ b/src/input_common/helpers/joycon_protocol/ringcon.cpp @@ -69,7 +69,7 @@ DriverResult RingConProtocol::StartRingconPolling() { DriverResult RingConProtocol::IsRingConnected(bool& is_connected) { LOG_DEBUG(Input, "IsRingConnected"); - constexpr std::size_t max_tries = 28; + constexpr static std::size_t max_tries = 28; SubCommandResponse output{}; std::size_t tries = 0; is_connected = false; |