diff options
| author | 2020-04-29 22:39:49 +1000 | |
|---|---|---|
| committer | 2020-04-29 22:39:49 +1000 | |
| commit | 973c40b63ed73201e835930e2e5ebbd6da990976 (patch) | |
| tree | 3dc6c8c98bbf4228046735f263cffdb29c88c17e /src | |
| parent | Merge pull request #3771 from benru/dump-romfs-with-updates (diff) | |
| download | yuzu-973c40b63ed73201e835930e2e5ebbd6da990976.tar.gz yuzu-973c40b63ed73201e835930e2e5ebbd6da990976.tar.xz yuzu-973c40b63ed73201e835930e2e5ebbd6da990976.zip | |
psm: Mark as debug instead of warning
No point to emulate battery life. However options are broken out if we ever want to add a setting for it
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/ptm/psm.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp index c2d5fda94..12d154ecf 100644 --- a/src/core/hle/service/ptm/psm.cpp +++ b/src/core/hle/service/ptm/psm.cpp | |||
| @@ -12,9 +12,6 @@ | |||
| 12 | 12 | ||
| 13 | namespace Service::PSM { | 13 | namespace Service::PSM { |
| 14 | 14 | ||
| 15 | constexpr u32 BATTERY_FULLY_CHARGED = 100; // 100% Full | ||
| 16 | constexpr u32 BATTERY_CURRENTLY_CHARGING = 1; // Plugged into an official dock | ||
| 17 | |||
| 18 | class PSM final : public ServiceFramework<PSM> { | 15 | class PSM final : public ServiceFramework<PSM> { |
| 19 | public: | 16 | public: |
| 20 | explicit PSM() : ServiceFramework{"psm"} { | 17 | explicit PSM() : ServiceFramework{"psm"} { |
| @@ -48,20 +45,30 @@ public: | |||
| 48 | 45 | ||
| 49 | private: | 46 | private: |
| 50 | void GetBatteryChargePercentage(Kernel::HLERequestContext& ctx) { | 47 | void GetBatteryChargePercentage(Kernel::HLERequestContext& ctx) { |
| 51 | LOG_WARNING(Service_PSM, "(STUBBED) called"); | 48 | LOG_DEBUG(Service_PSM, "called"); |
| 52 | 49 | ||
| 53 | IPC::ResponseBuilder rb{ctx, 3}; | 50 | IPC::ResponseBuilder rb{ctx, 3}; |
| 54 | rb.Push(RESULT_SUCCESS); | 51 | rb.Push(RESULT_SUCCESS); |
| 55 | rb.Push<u32>(BATTERY_FULLY_CHARGED); | 52 | rb.Push<u32>(battery_charge_percentage); |
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | void GetChargerType(Kernel::HLERequestContext& ctx) { | 55 | void GetChargerType(Kernel::HLERequestContext& ctx) { |
| 59 | LOG_WARNING(Service_PSM, "(STUBBED) called"); | 56 | LOG_DEBUG(Service_PSM, "called"); |
| 60 | 57 | ||
| 61 | IPC::ResponseBuilder rb{ctx, 3}; | 58 | IPC::ResponseBuilder rb{ctx, 3}; |
| 62 | rb.Push(RESULT_SUCCESS); | 59 | rb.Push(RESULT_SUCCESS); |
| 63 | rb.Push<u32>(BATTERY_CURRENTLY_CHARGING); | 60 | rb.PushEnum(charger_type); |
| 64 | } | 61 | } |
| 62 | |||
| 63 | enum class ChargerType : u32 { | ||
| 64 | Unplugged = 0, | ||
| 65 | RegularCharger = 1, | ||
| 66 | LowPowerCharger = 2, | ||
| 67 | Unknown = 3, | ||
| 68 | }; | ||
| 69 | |||
| 70 | u32 battery_charge_percentage{100}; // 100% | ||
| 71 | ChargerType charger_type{ChargerType::RegularCharger}; | ||
| 65 | }; | 72 | }; |
| 66 | 73 | ||
| 67 | void InstallInterfaces(SM::ServiceManager& sm) { | 74 | void InstallInterfaces(SM::ServiceManager& sm) { |