]> Chaos Git - corbenik/ctrulib.git/commitdiff
added APT_HardwareResetAsync (tested)
authorsmea <smealum@gmail.com>
Thu, 20 Nov 2014 01:25:40 +0000 (17:25 -0800)
committersmea <smealum@gmail.com>
Thu, 20 Nov 2014 01:25:40 +0000 (17:25 -0800)
libctru/include/3ds/services/apt.h
libctru/source/services/apt.c

index ad94d015d9d331f8320b3a2390c3c0b735b19c9d..af8fd5bdead3ea42e5e386d15d70e94e2cc7ea9c 100644 (file)
@@ -53,6 +53,7 @@ bool aptMainLoop(); // Use like this in your main(): while (aptMainLoop()) { you
 
 Result APT_GetLockHandle(Handle* handle, u16 flags, Handle* lockHandle);
 Result APT_Initialize(Handle* handle, NS_APPID appId, Handle* eventHandle1, Handle* eventHandle2);
+Result APT_HardwareResetAsync(Handle* handle);
 Result APT_Enable(Handle* handle, u32 a);
 Result APT_GetAppletManInfo(Handle* handle, u8 inval, u8 *outval8, u32 *outval32, NS_APPID *menu_appid, NS_APPID *active_appid);
 Result APT_PrepareToJumpToHomeMenu(Handle* handle);
index 4f417fa949127d317e1d5183ed2924fe31155f0d..ba8e1314908400f4da0c0397077e31bf9b57d3bf 100644 (file)
@@ -553,6 +553,18 @@ Result APT_Initialize(Handle* handle, NS_APPID appId, Handle* eventHandle1, Hand
        return cmdbuf[1];
 }
 
+Result APT_HardwareResetAsync(Handle* handle)
+{
+       if(!handle)handle=&aptuHandle;
+       u32* cmdbuf=getThreadCommandBuffer();
+       cmdbuf[0]=0x4E0000; //request header code
+       
+       Result ret=0;
+       if((ret=svcSendSyncRequest(*handle)))return ret;
+       
+       return cmdbuf[1];
+}
+
 Result APT_Enable(Handle* handle, u32 a)
 {
        if(!handle)handle=&aptuHandle;