diff options
author | german77 <juangerman-13@hotmail.com> | 2023-01-14 06:29:05 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-01-20 07:51:45 +0100 |
commit | 340f15d1fa79594dbe12a6e19140ba012751b533 (patch) | |
tree | 7a9ef54a17f927e4b8cf98dd32dd6d41c0d75201 /src/input_common/helpers/joycon_protocol/calibration.cpp | |
parent | core: hid: Only set the polling mode to the correct side (diff) | |
download | yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar.gz yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar.bz2 yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar.lz yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar.xz yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar.zst yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.zip |
Diffstat (limited to '')
-rw-r--r-- | src/input_common/helpers/joycon_protocol/calibration.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/input_common/helpers/joycon_protocol/calibration.cpp b/src/input_common/helpers/joycon_protocol/calibration.cpp index cd30ab869..f6e7e97d5 100644 --- a/src/input_common/helpers/joycon_protocol/calibration.cpp +++ b/src/input_common/helpers/joycon_protocol/calibration.cpp @@ -12,10 +12,10 @@ CalibrationProtocol::CalibrationProtocol(std::shared_ptr<JoyconHandle> handle) : JoyconCommonProtocol(std::move(handle)) {} DriverResult CalibrationProtocol::GetLeftJoyStickCalibration(JoyStickCalibration& calibration) { + ScopedSetBlocking sb(this); std::vector<u8> buffer; DriverResult result{DriverResult::Success}; calibration = {}; - SetBlocking(); result = ReadSPI(CalAddr::USER_LEFT_MAGIC, sizeof(u16), buffer); @@ -44,15 +44,14 @@ DriverResult CalibrationProtocol::GetLeftJoyStickCalibration(JoyStickCalibration // Set a valid default calibration if data is missing ValidateCalibration(calibration); - SetNonBlocking(); return result; } DriverResult CalibrationProtocol::GetRightJoyStickCalibration(JoyStickCalibration& calibration) { + ScopedSetBlocking sb(this); std::vector<u8> buffer; DriverResult result{DriverResult::Success}; calibration = {}; - SetBlocking(); result = ReadSPI(CalAddr::USER_RIGHT_MAGIC, sizeof(u16), buffer); @@ -81,15 +80,14 @@ DriverResult CalibrationProtocol::GetRightJoyStickCalibration(JoyStickCalibratio // Set a valid default calibration if data is missing ValidateCalibration(calibration); - SetNonBlocking(); return result; } DriverResult CalibrationProtocol::GetImuCalibration(MotionCalibration& calibration) { + ScopedSetBlocking sb(this); std::vector<u8> buffer; DriverResult result{DriverResult::Success}; calibration = {}; - SetBlocking(); result = ReadSPI(CalAddr::USER_IMU_MAGIC, sizeof(u16), buffer); @@ -124,7 +122,6 @@ DriverResult CalibrationProtocol::GetImuCalibration(MotionCalibration& calibrati ValidateCalibration(calibration); - SetNonBlocking(); return result; } |