summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/ptm/psm.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-01-31 10:38:57 +0100
committerbunnei <bunneidev@gmail.com>2021-02-05 23:03:32 +0100
commitff3c7c068b926399513bf7328c22e224ab0b53d6 (patch)
treec2a5d9f80ecf551659daa410cc384b1792eff31d /src/core/hle/service/ptm/psm.cpp
parenthle: kernel: Implement KEvent. (diff)
downloadyuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.gz
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.bz2
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.lz
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.xz
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.zst
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.zip
Diffstat (limited to 'src/core/hle/service/ptm/psm.cpp')
-rw-r--r--src/core/hle/service/ptm/psm.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp
index c1f7b33f1..26ed52273 100644
--- a/src/core/hle/service/ptm/psm.cpp
+++ b/src/core/hle/service/ptm/psm.cpp
@@ -7,6 +7,7 @@
#include "common/logging/log.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
+#include "core/hle/kernel/k_event.h"
#include "core/hle/kernel/k_readable_event.h"
#include "core/hle/kernel/k_writable_event.h"
#include "core/hle/kernel/kernel.h"
@@ -31,27 +32,28 @@ public:
RegisterHandlers(functions);
- state_change_event = Kernel::KWritableEvent::CreateEventPair(
- system_.Kernel(), "IPsmSession::state_change_event");
+ state_change_event =
+ Kernel::KEvent::Create(system_.Kernel(), "IPsmSession::state_change_event");
+ state_change_event->Initialize();
}
~IPsmSession() override = default;
void SignalChargerTypeChanged() {
if (should_signal && should_signal_charger_type) {
- state_change_event.writable->Signal();
+ state_change_event->GetWritableEvent()->Signal();
}
}
void SignalPowerSupplyChanged() {
if (should_signal && should_signal_power_supply) {
- state_change_event.writable->Signal();
+ state_change_event->GetWritableEvent()->Signal();
}
}
void SignalBatteryVoltageStateChanged() {
if (should_signal && should_signal_battery_voltage) {
- state_change_event.writable->Signal();
+ state_change_event->GetWritableEvent()->Signal();
}
}
@@ -63,7 +65,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(state_change_event.readable);
+ rb.PushCopyObjects(state_change_event->GetReadableEvent());
}
void UnbindStateChangeEvent(Kernel::HLERequestContext& ctx) {
@@ -112,7 +114,7 @@ private:
bool should_signal_power_supply{};
bool should_signal_battery_voltage{};
bool should_signal{};
- Kernel::EventPair state_change_event;
+ std::shared_ptr<Kernel::KEvent> state_change_event;
};
class PSM final : public ServiceFramework<PSM> {