From f2012e5aff21e1ba0d06bfab868191d221e8f7ed Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Thu, 25 Jan 2024 23:46:00 -0600 Subject: service: hid: Don't try to vibrate if device isn't initialized --- src/hid_core/resources/vibration/vibration_base.cpp | 4 ++++ src/hid_core/resources/vibration/vibration_base.h | 1 + 2 files changed, 5 insertions(+) (limited to 'src/hid_core/resources/vibration') diff --git a/src/hid_core/resources/vibration/vibration_base.cpp b/src/hid_core/resources/vibration/vibration_base.cpp index f28d30406..90bff88f4 100644 --- a/src/hid_core/resources/vibration/vibration_base.cpp +++ b/src/hid_core/resources/vibration/vibration_base.cpp @@ -23,6 +23,10 @@ Result NpadVibrationBase::Deactivate() { return ResultSuccess; } +bool NpadVibrationBase::IsActive() const { + return ref_counter > 0; +} + bool NpadVibrationBase::IsVibrationMounted() const { return is_mounted; } diff --git a/src/hid_core/resources/vibration/vibration_base.h b/src/hid_core/resources/vibration/vibration_base.h index 69c26e669..8fe35634d 100644 --- a/src/hid_core/resources/vibration/vibration_base.h +++ b/src/hid_core/resources/vibration/vibration_base.h @@ -21,6 +21,7 @@ public: virtual Result Activate(); virtual Result Deactivate(); + bool IsActive() const; bool IsVibrationMounted() const; protected: -- cgit v1.2.3