summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2022-05-06 01:58:00 +0200
committerNarr the Reg <juangerman-13@hotmail.com>2022-05-06 18:13:49 +0200
commitbabd580c6413187e9bffb65c81f3c23daec5fb71 (patch)
tree26c13463df740b8bfbe1213e1aa31efcc6c45d28 /src/core/hle/service/hid/controllers
parentservice: hid: Disable correctly motion input (diff)
downloadyuzu-babd580c6413187e9bffb65c81f3c23daec5fb71.tar
yuzu-babd580c6413187e9bffb65c81f3c23daec5fb71.tar.gz
yuzu-babd580c6413187e9bffb65c81f3c23daec5fb71.tar.bz2
yuzu-babd580c6413187e9bffb65c81f3c23daec5fb71.tar.lz
yuzu-babd580c6413187e9bffb65c81f3c23daec5fb71.tar.xz
yuzu-babd580c6413187e9bffb65c81f3c23daec5fb71.tar.zst
yuzu-babd580c6413187e9bffb65c81f3c23daec5fb71.zip
Diffstat (limited to 'src/core/hle/service/hid/controllers')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 1e9ff8132..de06e1735 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -3,7 +3,9 @@
#include <algorithm>
#include <array>
+#include <chrono>
#include <cstring>
+
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/common_types.h"
@@ -547,7 +549,9 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
const auto set_motion_state = [&](SixAxisSensorState& state,
const Core::HID::ControllerMotion& hid_state) {
+ using namespace std::literals::chrono_literals;
static constexpr SixAxisSensorState default_motion_state = {
+ .delta_time = std::chrono::nanoseconds(5ms).count(),
.accel = {0, 0, -1.0f},
.orientation =
{
@@ -566,6 +570,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
return;
}
state.attribute.is_connected.Assign(1);
+ state.delta_time = std::chrono::nanoseconds(5ms).count();
state.accel = hid_state.accel;
state.gyro = hid_state.gyro;
state.rotation = hid_state.rotation;