diff options
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp b/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp index d68b0441a6..82e2cfedda 100644 --- a/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp @@ -82,14 +82,14 @@ using UndetectableSignedAnalogInput = SignedInput<false>; class Motor final : public Core::Device::Output { public: - Motor(ControlState* value) : m_value(*value) {} + Motor(std::atomic<ControlState>* value) : m_value(*value) {} std::string GetName() const override { return "Motor"; } void SetState(ControlState state) override { m_value = state; } private: - ControlState& m_value; + std::atomic<ControlState>& m_value; }; template <typename T> @@ -1377,7 +1377,8 @@ void Device::UpdateRumble() { static constexpr auto rumble_period = std::chrono::milliseconds(100); - const auto on_time = std::chrono::duration_cast<Clock::duration>(rumble_period * m_rumble_level); + const auto on_time = + std::chrono::duration_cast<Clock::duration>(rumble_period * m_rumble_level.load()); const auto off_time = rumble_period - on_time; const auto now = Clock::now(); |
