ir: Add IRU_GetSend/RecvFinishedEvent

This commit is contained in:
GaryOderNichts 2022-11-25 22:07:37 +01:00
parent af5321c78e
commit 63e512ce12
2 changed files with 42 additions and 0 deletions

View File

@ -91,3 +91,15 @@ Result IRU_SetIRLEDState(u32 value);
* @param out Pointer to write the IR LED state to.
*/
Result IRU_GetIRLEDRecvState(u32 *out);
/**
* @brief Gets an event which is signaled once a send finishes.
* @param out Pointer to write the event handle to.
*/
Result IRU_GetSendFinishedEvent(Handle *out);
/**
* @brief Gets an event which is signaled once a receive finishes.
* @param out Pointer to write the event handle to.
*/
Result IRU_GetRecvFinishedEvent(Handle *out);

View File

@ -237,3 +237,33 @@ Result IRU_GetIRLEDRecvState(u32 *out)
return ret;
}
Result IRU_GetSendFinishedEvent(Handle *out)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0xD,0,0); // 0xD0000
if(R_FAILED(ret = svcSendSyncRequest(iruHandle)))return ret;
ret = (Result)cmdbuf[1];
*out = (Handle)cmdbuf[3];
return ret;
}
Result IRU_GetRecvFinishedEvent(Handle *out)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0xE,0,0); // 0xE0000
if(R_FAILED(ret = svcSendSyncRequest(iruHandle)))return ret;
ret = (Result)cmdbuf[1];
*out = (Handle)cmdbuf[3];
return ret;
}