Add PTMU_GetAdapterState (#361)
This commit is contained in:
parent
49f99a0650
commit
8d177742ae
@ -40,3 +40,8 @@ Result PTMU_GetPedometerState(u8 *out);
|
||||
*/
|
||||
Result PTMU_GetTotalStepCount(u32 *steps);
|
||||
|
||||
/**
|
||||
* @brief Gets whether the adapter is plugged in or not
|
||||
* @param out Pointer to write the adapter state to.
|
||||
*/
|
||||
Result PTMU_GetAdapterState(bool *out);
|
||||
|
@ -94,3 +94,16 @@ Result PTMU_GetTotalStepCount(u32 *steps)
|
||||
return (Result)cmdbuf[1];
|
||||
}
|
||||
|
||||
Result PTMU_GetAdapterState(bool *out)
|
||||
{
|
||||
Result ret=0;
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(0x5,0,0); // 0x50000
|
||||
|
||||
if(R_FAILED(ret = svcSendSyncRequest(ptmuHandle)))return ret;
|
||||
|
||||
*out = cmdbuf[2] & 0xFF;
|
||||
|
||||
return (Result)cmdbuf[1];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user