fix formatting

This commit is contained in:
dark-samus 2018-11-17 01:51:42 -05:00
parent 7f2c3f7d3c
commit e51c787d84

View File

@ -105,81 +105,74 @@ Result pcvGetClockRate(PcvModule module, u32 *out_hz) {
return rc; return rc;
} }
Result pcvSetVoltageEnabled(bool state, u32 voltage) Result pcvSetVoltageEnabled(bool state, u32 voltage) {
{ IpcCommand c;
IpcCommand c; ipcInitialize(&c);
ipcInitialize(&c);
struct
{
u64 magic;
u64 cmd_id;
bool state;
u32 voltage;
} *raw;
raw = serviceIpcPrepareHeader(&g_pcvSrv, &c, sizeof(*raw));
raw->magic = SFCI_MAGIC;
raw->cmd_id = 8;
raw->state = state;
raw->voltage = voltage;
Result rc = serviceIpcDispatch(&g_pcvSrv);
if (R_SUCCEEDED(rc))
{
IpcParsedCommand r;
struct { struct {
u64 magic; u64 magic;
u64 result; u64 cmd_id;
} *resp; bool state;
u32 voltage;
} *raw;
serviceIpcParse(&g_pcvSrv, &r, sizeof(*resp)); raw = serviceIpcPrepareHeader(&g_pcvSrv, &c, sizeof(*raw));
resp = r.Raw;
rc = resp->result; raw->magic = SFCI_MAGIC;
} raw->cmd_id = 8;
raw->state = state;
raw->voltage = voltage;
return rc; Result rc = serviceIpcDispatch(&g_pcvSrv);
if (R_SUCCEEDED(rc)) {
IpcParsedCommand r;
struct {
u64 magic;
u64 result;
} *resp;
serviceIpcParse(&g_pcvSrv, &r, sizeof(*resp));
resp = r.Raw;
rc = resp->result;
}
return rc;
} }
Result pcvGetVoltageEnabled(bool *isEnabled, u32 voltage) Result pcvGetVoltageEnabled(bool *isEnabled, u32 voltage) {
{ IpcCommand c;
IpcCommand c; ipcInitialize(&c);
ipcInitialize(&c);
struct
{
u64 magic;
u64 cmd_id;
u32 voltage;
} *raw;
raw = serviceIpcPrepareHeader(&g_pcvSrv, &c, sizeof(*raw));
raw->magic = SFCI_MAGIC;
raw->cmd_id = 9;
raw->voltage = voltage;
Result rc = serviceIpcDispatch(&g_pcvSrv);
if (R_SUCCEEDED(rc))
{
IpcParsedCommand r;
struct { struct {
u64 magic;
u64 cmd_id;
u32 voltage;
} *raw;
raw = serviceIpcPrepareHeader(&g_pcvSrv, &c, sizeof(*raw));
raw->magic = SFCI_MAGIC;
raw->cmd_id = 9;
raw->voltage = voltage;
Result rc = serviceIpcDispatch(&g_pcvSrv);
if (R_SUCCEEDED(rc)) {
IpcParsedCommand r;
struct {
u64 magic; u64 magic;
u64 result; u64 result;
bool isEnabled; bool isEnabled;
} *resp; } *resp;
serviceIpcParse(&g_pcvSrv, &r, sizeof(*resp)); serviceIpcParse(&g_pcvSrv, &r, sizeof(*resp));
resp = r.Raw; resp = r.Raw;
rc = resp->result; rc = resp->result;
*isEnabled = resp->isEnabled; *isEnabled = resp->isEnabled;
} }
return rc;
return rc;
} }