diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-01-30 15:02:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 15:02:12 +0100 |
commit | e74660673b68e7226b7e934efe5eac620f7a98e6 (patch) | |
tree | 355def233607668733581b2b5194d0e54e1b7995 /src/input_common/helpers/joycon_driver.cpp | |
parent | Merge pull request #9631 from vonchenplus/vulkan_clear (diff) | |
parent | input_common: joycon: Remove Magic numbers from common protocol (diff) | |
download | yuzu-e74660673b68e7226b7e934efe5eac620f7a98e6.tar yuzu-e74660673b68e7226b7e934efe5eac620f7a98e6.tar.gz yuzu-e74660673b68e7226b7e934efe5eac620f7a98e6.tar.bz2 yuzu-e74660673b68e7226b7e934efe5eac620f7a98e6.tar.lz yuzu-e74660673b68e7226b7e934efe5eac620f7a98e6.tar.xz yuzu-e74660673b68e7226b7e934efe5eac620f7a98e6.tar.zst yuzu-e74660673b68e7226b7e934efe5eac620f7a98e6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/input_common/helpers/joycon_driver.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/input_common/helpers/joycon_driver.cpp b/src/input_common/helpers/joycon_driver.cpp index 3775e2d35..8f94c9f45 100644 --- a/src/input_common/helpers/joycon_driver.cpp +++ b/src/input_common/helpers/joycon_driver.cpp @@ -162,14 +162,14 @@ void JoyconDriver::InputThread(std::stop_token stop_token) { } void JoyconDriver::OnNewData(std::span<u8> buffer) { - const auto report_mode = static_cast<InputReport>(buffer[0]); + const auto report_mode = static_cast<ReportMode>(buffer[0]); // Packages can be a litte bit inconsistent. Average the delta time to provide a smoother motion // experience switch (report_mode) { - case InputReport::STANDARD_FULL_60HZ: - case InputReport::NFC_IR_MODE_60HZ: - case InputReport::SIMPLE_HID_MODE: { + case ReportMode::STANDARD_FULL_60HZ: + case ReportMode::NFC_IR_MODE_60HZ: + case ReportMode::SIMPLE_HID_MODE: { const auto now = std::chrono::steady_clock::now(); const auto new_delta_time = static_cast<u64>( std::chrono::duration_cast<std::chrono::microseconds>(now - last_update).count()); @@ -190,7 +190,7 @@ void JoyconDriver::OnNewData(std::span<u8> buffer) { }; // TODO: Remove this when calibration is properly loaded and not calculated - if (ring_connected && report_mode == InputReport::STANDARD_FULL_60HZ) { + if (ring_connected && report_mode == ReportMode::STANDARD_FULL_60HZ) { InputReportActive data{}; memcpy(&data, buffer.data(), sizeof(InputReportActive)); calibration_protocol->GetRingCalibration(ring_calibration, data.ring_input); @@ -228,16 +228,16 @@ void JoyconDriver::OnNewData(std::span<u8> buffer) { } switch (report_mode) { - case InputReport::STANDARD_FULL_60HZ: + case ReportMode::STANDARD_FULL_60HZ: joycon_poller->ReadActiveMode(buffer, motion_status, ring_status); break; - case InputReport::NFC_IR_MODE_60HZ: + case ReportMode::NFC_IR_MODE_60HZ: joycon_poller->ReadNfcIRMode(buffer, motion_status); break; - case InputReport::SIMPLE_HID_MODE: + case ReportMode::SIMPLE_HID_MODE: joycon_poller->ReadPassiveMode(buffer); break; - case InputReport::SUBCMD_REPLY: + case ReportMode::SUBCMD_REPLY: LOG_DEBUG(Input, "Unhandled command reply"); break; default: |