3DSident/source/mcu.c
Joel 827f1772d2 Get actual battery percentage thanks to Spaqin
Removed ir:u service because it isn't required in this program. Besides
I had to make room for mcu::HWC.

I also forgot to mention I got the ACTU functions from MrCheeze.
Many thanks to him.
2016-09-23 00:24:14 -05:00

21 lines
377 B
C

#include "mcu.h"
Result mcuInit()
{
return srvGetServiceHandle(&mcuhwcHandle, "mcu::HWC");
}
Result mcuExit()
{
return svcCloseHandle(mcuhwcHandle);
}
Result mcuGetBatteryLevel(u8* out)
{
u32* ipc = getThreadCommandBuffer();
ipc[0] = 0x50000;
Result ret = svcSendSyncRequest(mcuhwcHandle);
if(ret < 0) return ret;
*out = ipc[2];
return ipc[1];
}