diff options
author | bunnei <bunneidev@gmail.com> | 2018-12-03 23:05:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-03 23:05:57 +0100 |
commit | ef69b4b83050967732e6e977396111289c9e86ba (patch) | |
tree | 0f0908b21f5cec9dca4d2269cd724cfca81848db /src/core/hle/service/hid/controllers/npad.cpp | |
parent | Merge pull request #1833 from lioncash/clean (diff) | |
parent | hle_ipc: Refactor SleepClientThread to avoid ReadableEvent (diff) | |
download | yuzu-ef69b4b83050967732e6e977396111289c9e86ba.tar yuzu-ef69b4b83050967732e6e977396111289c9e86ba.tar.gz yuzu-ef69b4b83050967732e6e977396111289c9e86ba.tar.bz2 yuzu-ef69b4b83050967732e6e977396111289c9e86ba.tar.lz yuzu-ef69b4b83050967732e6e977396111289c9e86ba.tar.xz yuzu-ef69b4b83050967732e6e977396111289c9e86ba.tar.zst yuzu-ef69b4b83050967732e6e977396111289c9e86ba.zip |
Diffstat (limited to 'src/core/hle/service/hid/controllers/npad.cpp')
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index b49e34594..d6829d0b8 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -12,7 +12,9 @@ #include "core/core.h" #include "core/core_timing.h" #include "core/frontend/input.h" -#include "core/hle/kernel/event.h" +#include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/readable_event.h" +#include "core/hle/kernel/writable_event.h" #include "core/hle/service/hid/controllers/npad.h" #include "core/settings.h" @@ -167,8 +169,8 @@ void Controller_NPad::InitNewlyAddedControler(std::size_t controller_idx) { void Controller_NPad::OnInit() { auto& kernel = Core::System::GetInstance().Kernel(); - styleset_changed_event = - Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "npad:NpadStyleSetChanged"); + styleset_changed_event = Kernel::WritableEvent::CreateEventPair( + kernel, Kernel::ResetType::OneShot, "npad:NpadStyleSetChanged"); if (!IsControllerActivated()) { return; @@ -494,7 +496,7 @@ void Controller_NPad::SetSupportedNPadIdTypes(u8* data, std::size_t length) { had_controller_update = true; } if (had_controller_update) { - styleset_changed_event->Signal(); + styleset_changed_event.writable->Signal(); } } } @@ -509,7 +511,7 @@ std::size_t Controller_NPad::GetSupportedNPadIdTypesSize() const { } void Controller_NPad::SetHoldType(NpadHoldType joy_hold_type) { - styleset_changed_event->Signal(); + styleset_changed_event.writable->Signal(); hold_type = joy_hold_type; } @@ -539,11 +541,11 @@ void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids, last_processed_vibration = vibrations.back(); } -Kernel::SharedPtr<Kernel::Event> Controller_NPad::GetStyleSetChangedEvent() const { +Kernel::SharedPtr<Kernel::ReadableEvent> Controller_NPad::GetStyleSetChangedEvent() const { // TODO(ogniK): Figure out the best time to signal this event. This event seems that it should // be signalled at least once, and signaled after a new controller is connected? - styleset_changed_event->Signal(); - return styleset_changed_event; + styleset_changed_event.writable->Signal(); + return styleset_changed_event.readable; } Controller_NPad::Vibration Controller_NPad::GetLastVibration() const { |