mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-04 18:42:15 +02:00
version check on pre-8.0.0 pcv funcs
This commit is contained in:
parent
6b50fddd9b
commit
45888af381
@ -20,4 +20,3 @@ Result pcvGetClockRate(PcvModule module, u32 *out_hz);
|
||||
Result pcvSetClockRate(PcvModule module, u32 hz);
|
||||
Result pcvSetVoltageEnabled(bool state, u32 voltage);
|
||||
Result pcvGetVoltageEnabled(bool *isEnabled, u32 voltage);
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "result.h"
|
||||
#include "arm/atomics.h"
|
||||
#include "kernel/ipc.h"
|
||||
#include "runtime/hosversion.h"
|
||||
#include "services/pcv.h"
|
||||
#include "services/sm.h"
|
||||
|
||||
@ -30,6 +31,10 @@ void pcvExit(void) {
|
||||
}
|
||||
|
||||
Result pcvSetClockRate(PcvModule module, u32 hz) {
|
||||
if(hosversionAtLeast(8,0,0)) {
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
}
|
||||
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
@ -66,6 +71,10 @@ Result pcvSetClockRate(PcvModule module, u32 hz) {
|
||||
}
|
||||
|
||||
Result pcvGetClockRate(PcvModule module, u32 *out_hz) {
|
||||
if(hosversionAtLeast(8,0,0)) {
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
}
|
||||
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
@ -105,6 +114,10 @@ Result pcvGetClockRate(PcvModule module, u32 *out_hz) {
|
||||
}
|
||||
|
||||
Result pcvSetVoltageEnabled(bool state, u32 voltage) {
|
||||
if(hosversionAtLeast(8,0,0)) {
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
}
|
||||
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
@ -141,6 +154,10 @@ Result pcvSetVoltageEnabled(bool state, u32 voltage) {
|
||||
}
|
||||
|
||||
Result pcvGetVoltageEnabled(bool *isEnabled, u32 voltage) {
|
||||
if(hosversionAtLeast(8,0,0)) {
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
}
|
||||
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user